Changes in src/Parser/DeclarationNode.cc [d180746:e3e16bc]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
rd180746 re3e16bc 14 14 // 15 15 16 #include <cassert> // for assert, assertf, s afe_dynamic_cast16 #include <cassert> // for assert, assertf, strict_dynamic_cast 17 17 #include <iterator> // for back_insert_iterator 18 18 #include <list> // for list … … 340 340 } // DeclarationNode::newTypeDecl 341 341 342 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {343 DeclarationNode * newnode = new DeclarationNode; 344 newnode->type = new TypeData( TypeData::Pointer);342 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) { 343 DeclarationNode * newnode = new DeclarationNode; 344 newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference ); 345 345 if ( qualifiers ) { 346 346 return newnode->addQualifiers( qualifiers ); … … 759 759 DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) { 760 760 if ( p ) { 761 assert( p->type->kind == TypeData::Pointer );761 assert( p->type->kind == TypeData::Pointer || TypeData::Reference ); 762 762 setBase( p->type ); 763 763 p->type = nullptr; … … 781 781 DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) { 782 782 if ( p ) { 783 assert( p->type->kind == TypeData::Pointer );783 assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference ); 784 784 if ( type ) { 785 785 switch ( type->kind ) { … … 1027 1027 1028 1028 if ( asmStmt ) { 1029 return new AsmDecl( s afe_dynamic_cast<AsmStmt *>( asmStmt->build() ) );1029 return new AsmDecl( strict_dynamic_cast<AsmStmt *>( asmStmt->build() ) ); 1030 1030 } // if 1031 1031
Note:
See TracChangeset
for help on using the changeset viewer.