Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/DeclarationNode.cc

    rd180746 re3e16bc  
    1414//
    1515
    16 #include <cassert>                 // for assert, assertf, safe_dynamic_cast
     16#include <cassert>                 // for assert, assertf, strict_dynamic_cast
    1717#include <iterator>                // for back_insert_iterator
    1818#include <list>                    // for list
     
    340340} // DeclarationNode::newTypeDecl
    341341
    342 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {
    343         DeclarationNode * newnode = new DeclarationNode;
    344         newnode->type = new TypeData( TypeData::Pointer );
     342DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) {
     343        DeclarationNode * newnode = new DeclarationNode;
     344        newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference );
    345345        if ( qualifiers ) {
    346346                return newnode->addQualifiers( qualifiers );
     
    759759DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) {
    760760        if ( p ) {
    761                 assert( p->type->kind == TypeData::Pointer );
     761                assert( p->type->kind == TypeData::Pointer || TypeData::Reference );
    762762                setBase( p->type );
    763763                p->type = nullptr;
     
    781781DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) {
    782782        if ( p ) {
    783                 assert( p->type->kind == TypeData::Pointer );
     783                assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference );
    784784                if ( type ) {
    785785                        switch ( type->kind ) {
     
    10271027
    10281028        if ( asmStmt ) {
    1029                 return new AsmDecl( safe_dynamic_cast<AsmStmt *>( asmStmt->build() ) );
     1029                return new AsmDecl( strict_dynamic_cast<AsmStmt *>( asmStmt->build() ) );
    10301030        } // if
    10311031
Note: See TracChangeset for help on using the changeset viewer.