Changes in / [46aa60e:1761046]
- Files:
-
- 9 edited
-
doc/LaTeXmacros/lstlang.sty (modified) (2 diffs)
-
src/AST/Attribute.hpp (modified) (2 diffs)
-
src/Parser/DeclarationNode.cc (modified) (8 diffs)
-
src/Parser/DeclarationNode.h (modified) (3 diffs)
-
src/Parser/TypeData.cc (modified) (9 diffs)
-
src/Parser/TypeData.h (modified) (2 diffs)
-
src/Parser/parser.yy (modified) (13 diffs)
-
tests/.expect/attributes.x64.txt (modified) (1 diff)
-
tests/errors/.expect/declaration.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/LaTeXmacros/lstlang.sty
r46aa60e r1761046 8 8 %% Created On : Sat May 13 16:34:42 2017 9 9 %% Last Modified By : Peter A. Buhr 10 %% Last Modified On : Fri Feb 16 07:59:29202411 %% Update Count : 3 710 %% Last Modified On : Tue Feb 13 13:27:00 2024 11 %% Update Count : 36 12 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 13 … … 125 125 } 126 126 127 % C++ programming language 128 \lstdefinelanguage{C++}[ANSI]{C++}{ 129 morekeywords={nullptr,} 130 } 131 127 132 % uC++ programming language, based on ANSI C++ 128 \lstdefinelanguage{uC++}[ GNU]{C++}{133 \lstdefinelanguage{uC++}[ANSI]{C++}{ 129 134 morekeywords={ 130 135 _Accept, _AcceptReturn, _AcceptWait, _Actor, _At, _Catch, _CatchResume, _CorActor, _Cormonitor, _Coroutine, -
src/AST/Attribute.hpp
r46aa60e r1761046 9 9 // Author : Aaron B. Moss 10 10 // Created On : Fri May 10 10:30:00 2019 11 // Last Modified By : Peter A. Buhr11 // Last Modified By : Aaron B. Moss 12 12 // Created On : Fri May 10 10:30:00 2019 13 // Update Count : 213 // Update Count : 1 14 14 // 15 15 … … 34 34 35 35 Attribute( const std::string & name = "", std::vector<ptr<Expr>> && params = {}) 36 : name( name ), params( params ) {}36 : name( name ), params( params ) {} 37 37 virtual ~Attribute() = default; 38 38 -
src/Parser/DeclarationNode.cc
r46aa60e r1761046 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 23 18:25:57 202413 // Update Count : 1 53312 // Last Modified On : Thu Dec 14 19:05:17 2023 13 // Update Count : 1407 14 14 // 15 15 … … 159 159 160 160 if ( ! attributes.empty() ) { 161 os << string( indent + 2, ' ' ) << "with attributes " << endl;161 os << string( indent + 2, ' ' ) << "with attributes " << endl; 162 162 for ( ast::ptr<ast::Attribute> const & attr : reverseIterate( attributes ) ) { 163 os << string( indent + 4, ' ' ); 164 ast::print( os, attr, indent + 2 ); 163 os << string( indent + 4, ' ' ) << attr->name.c_str() << endl; 165 164 } // for 166 165 } // if … … 538 537 } // DeclarationNode::checkSpecifiers 539 538 540 DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q , bool copyattr) {539 DeclarationNode * DeclarationNode::copySpecifiers( DeclarationNode * q ) { 541 540 funcSpecs |= q->funcSpecs; 542 541 storageClasses |= q->storageClasses; 543 542 544 if ( copyattr ) { 545 std::vector<ast::ptr<ast::Attribute>> tmp; 546 tmp.reserve( q->attributes.size() ); 547 for ( auto const & attr : q->attributes ) { 548 tmp.emplace_back( ast::shallowCopy( attr.get() ) ); 549 } // for 550 spliceBegin( attributes, tmp ); 551 } // if 543 std::vector<ast::ptr<ast::Attribute>> tmp; 544 tmp.reserve( q->attributes.size() ); 545 for ( auto const & attr : q->attributes ) { 546 tmp.emplace_back( ast::shallowCopy( attr.get() ) ); 547 } 548 spliceBegin( attributes, tmp ); 552 549 553 550 return this; … … 684 681 } 685 682 686 DeclarationNode * DeclarationNode::addType( DeclarationNode * o , bool copyattr) {683 DeclarationNode * DeclarationNode::addType( DeclarationNode * o ) { 687 684 if ( o ) { 688 685 checkSpecifiers( o ); 689 copySpecifiers( o , copyattr);686 copySpecifiers( o ); 690 687 if ( o->type ) { 691 688 if ( ! type ) { 692 689 if ( o->type->kind == TypeData::Aggregate || o->type->kind == TypeData::Enum ) { 693 // Hide type information aggregate instances.694 690 type = new TypeData( TypeData::AggregateInst ); 695 type->aggInst.aggregate = o->type; // change ownership 696 type->aggInst.aggregate->aggregate.attributes.swap( o->attributes ); // change ownership 691 type->aggInst.aggregate = o->type; 697 692 if ( o->type->kind == TypeData::Aggregate ) { 698 693 type->aggInst.hoistType = o->type->aggregate.body; … … 705 700 type = o->type; 706 701 } // if 707 o->type = nullptr; // change ownership702 o->type = nullptr; 708 703 } else { 709 704 addTypeToType( o->type, type ); … … 958 953 } 959 954 960 DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o , bool copyattr) {955 DeclarationNode * DeclarationNode::cloneBaseType( DeclarationNode * o ) { 961 956 if ( ! o ) return nullptr; 962 957 963 o->copySpecifiers( this , copyattr);958 o->copySpecifiers( this ); 964 959 if ( type ) { 965 960 TypeData * srcType = type; … … 1004 999 DeclarationNode * newnode = new DeclarationNode; 1005 1000 newnode->type = ret; 1006 if ( ret->kind == TypeData::Aggregate ) {1007 newnode->attributes.swap( ret->aggregate.attributes );1008 } // if1009 1001 return newnode; 1010 1002 } // if … … 1118 1110 if ( extr->type->kind == TypeData::Aggregate ) { 1119 1111 // typedef struct { int A } B is the only case? 1120 extracted_named = ! extr->type->aggregate.anon;1112 extracted_named = !extr->type->aggregate.anon; 1121 1113 } else if ( extr->type->kind == TypeData::Enum ) { 1122 1114 // typedef enum { A } B is the only case? 1123 extracted_named = ! extr->type->enumeration.anon;1115 extracted_named = !extr->type->enumeration.anon; 1124 1116 } else { 1125 1117 extracted_named = true; -
src/Parser/DeclarationNode.h
r46aa60e r1761046 9 9 // Author : Andrew Beach 10 10 // Created On : Wed Apr 5 11:38:00 2023 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Feb 17 09:24:12 202413 // Update Count : 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Apr 5 11:55:00 2023 13 // Update Count : 0 14 14 // 15 15 … … 83 83 void checkQualifiers( const TypeData *, const TypeData * ); 84 84 void checkSpecifiers( DeclarationNode * ); 85 DeclarationNode * copySpecifiers( DeclarationNode * , bool = true);86 DeclarationNode * addType( DeclarationNode * , bool = true);85 DeclarationNode * copySpecifiers( DeclarationNode * ); 86 DeclarationNode * addType( DeclarationNode * ); 87 87 DeclarationNode * addTypedef(); 88 88 DeclarationNode * addEnumBase( DeclarationNode * ); … … 106 106 107 107 DeclarationNode * cloneType( std::string * newName ); 108 DeclarationNode * cloneBaseType( DeclarationNode * newdecl , bool = true);108 DeclarationNode * cloneBaseType( DeclarationNode * newdecl ); 109 109 110 110 DeclarationNode * appendList( DeclarationNode * node ) { -
src/Parser/TypeData.cc
r46aa60e r1761046 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 23 08:58:30 202413 // Update Count : 73412 // Last Modified On : Thu Dec 14 18:59:12 2023 13 // Update Count : 684 14 14 // 15 15 … … 20 20 21 21 #include "AST/Decl.hpp" // for AggregateDecl, ObjectDecl, TypeDe... 22 #include "AST/Attribute.hpp" // for Attribute23 22 #include "AST/Init.hpp" // for SingleInit, ListInit 24 23 #include "AST/Print.hpp" // for print 25 24 #include "Common/SemanticError.h" // for SemanticError 26 25 #include "Common/utility.h" // for splice, spliceBegin 27 #include "Common/Iterate.hpp" // for reverseIterate28 26 #include "Parser/ExpressionNode.h" // for ExpressionNode 29 27 #include "Parser/StatementNode.h" // for StatementNode … … 201 199 newtype->aggregate.kind = aggregate.kind; 202 200 newtype->aggregate.name = aggregate.name ? new string( *aggregate.name ) : nullptr; 203 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr;204 201 newtype->aggregate.params = maybeCopy( aggregate.params ); 205 202 newtype->aggregate.actuals = maybeCopy( aggregate.actuals ); 206 203 newtype->aggregate.fields = maybeCopy( aggregate.fields ); 207 newtype->aggregate.attributes = aggregate.attributes;208 204 newtype->aggregate.body = aggregate.body; 209 205 newtype->aggregate.anon = aggregate.anon; 210 206 newtype->aggregate.tagged = aggregate.tagged; 207 newtype->aggregate.parent = aggregate.parent ? new string( *aggregate.parent ) : nullptr; 211 208 break; 212 209 case AggregateInst: … … 339 336 } // if 340 337 if ( aggregate.body ) { 341 os << string( indent + 2, ' ' ) << "with body" << endl; 342 } // if 343 if ( ! aggregate.attributes.empty() ) { 344 os << string( indent + 2, ' ' ) << "with attributes" << endl; 345 for ( ast::ptr<ast::Attribute> const & attr : reverseIterate( aggregate.attributes ) ) { 346 os << string( indent + 4, ' ' ); 347 ast::print( os, attr, indent + 2 ); 348 } // for 338 os << string( indent + 2, ' ' ) << " with body" << endl; 349 339 } // if 350 340 break; … … 368 358 } // if 369 359 if ( enumeration.body ) { 370 os << string( indent + 2, ' ' ) << " with body" << endl;360 os << string( indent + 2, ' ' ) << " with body" << endl; 371 361 } // if 372 362 if ( base ) { … … 1098 1088 1099 1089 ast::BaseInstType * buildComAggInst( 1100 const TypeData * t d,1090 const TypeData * type, 1101 1091 std::vector<ast::ptr<ast::Attribute>> && attributes, 1102 1092 ast::Linkage::Spec linkage ) { 1103 switch ( t d->kind ) {1093 switch ( type->kind ) { 1104 1094 case TypeData::Enum: 1105 if ( t d->enumeration.body ) {1095 if ( type->enumeration.body ) { 1106 1096 ast::EnumDecl * typedecl = 1107 buildEnum( t d, std::move( attributes ), linkage );1097 buildEnum( type, std::move( attributes ), linkage ); 1108 1098 return new ast::EnumInstType( 1109 1099 typedecl, 1110 buildQualifiers( t d)1100 buildQualifiers( type ) 1111 1101 ); 1112 1102 } else { 1113 1103 return new ast::EnumInstType( 1114 *t d->enumeration.name,1115 buildQualifiers( t d)1104 *type->enumeration.name, 1105 buildQualifiers( type ) 1116 1106 ); 1117 1107 } // if 1118 1108 break; 1119 1109 case TypeData::Aggregate: 1120 if ( t d->aggregate.body ) {1110 if ( type->aggregate.body ) { 1121 1111 ast::AggregateDecl * typedecl = 1122 buildAggregate( t d, std::move( attributes ), linkage );1123 switch ( t d->aggregate.kind ) {1112 buildAggregate( type, std::move( attributes ), linkage ); 1113 switch ( type->aggregate.kind ) { 1124 1114 case ast::AggregateDecl::Struct: 1125 1115 case ast::AggregateDecl::Coroutine: … … 1128 1118 return new ast::StructInstType( 1129 1119 strict_dynamic_cast<ast::StructDecl *>( typedecl ), 1130 buildQualifiers( t d)1120 buildQualifiers( type ) 1131 1121 ); 1132 1122 case ast::AggregateDecl::Union: 1133 1123 return new ast::UnionInstType( 1134 1124 strict_dynamic_cast<ast::UnionDecl *>( typedecl ), 1135 buildQualifiers( t d)1125 buildQualifiers( type ) 1136 1126 ); 1137 1127 case ast::AggregateDecl::Trait: … … 1142 1132 } // switch 1143 1133 } else { 1144 switch ( t d->aggregate.kind ) {1134 switch ( type->aggregate.kind ) { 1145 1135 case ast::AggregateDecl::Struct: 1146 1136 case ast::AggregateDecl::Coroutine: … … 1148 1138 case ast::AggregateDecl::Thread: 1149 1139 return new ast::StructInstType( 1150 *t d->aggregate.name,1151 buildQualifiers( t d)1140 *type->aggregate.name, 1141 buildQualifiers( type ) 1152 1142 ); 1153 1143 case ast::AggregateDecl::Union: 1154 1144 return new ast::UnionInstType( 1155 *t d->aggregate.name,1156 buildQualifiers( t d)1145 *type->aggregate.name, 1146 buildQualifiers( type ) 1157 1147 ); 1158 1148 case ast::AggregateDecl::Trait: 1159 1149 return new ast::TraitInstType( 1160 *t d->aggregate.name,1161 buildQualifiers( t d)1150 *type->aggregate.name, 1151 buildQualifiers( type ) 1162 1152 ); 1163 1153 default: -
src/Parser/TypeData.h
r46aa60e r1761046 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat May 16 15:18:36 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Feb 22 16:30:31 202413 // Update Count : 2 1011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Mar 1 10:44:00 2023 13 // Update Count : 206 14 14 // 15 15 … … 30 30 ast::AggregateDecl::Aggregate kind; 31 31 const std::string * name = nullptr; 32 const std::string * parent = nullptr;33 32 DeclarationNode * params = nullptr; 34 33 ExpressionNode * actuals = nullptr; // holds actual parameters later applied to AggInst 35 34 DeclarationNode * fields = nullptr; 36 std::vector<ast::ptr<ast::Attribute>> attributes;37 35 bool body; 38 36 bool anon; 39 37 bool tagged; 38 const std::string * parent = nullptr; 40 39 }; 41 40 -
src/Parser/parser.yy
r46aa60e r1761046 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 23 18:25:46 202413 // Update Count : 6 48412 // Last Modified On : Sun Nov 26 13:18:06 2023 13 // Update Count : 6398 14 14 // 15 15 … … 102 102 103 103 DeclarationNode * distAttr( DeclarationNode * typeSpec, DeclarationNode * declList ) { 104 // Distribute type specifier across all declared variables, e.g., static, const,__attribute__.104 // distribute declaration_specifier across all declared variables, e.g., static, const, but not __attribute__. 105 105 assert( declList ); 106 107 // Do not distribute attributes for aggregates because the attributes surrounding the aggregate belong it not the 108 // variables in the declaration list, e.g., 109 // 110 // struct __attribute__(( aligned(128) )) S { ... 111 // } v1 __attribute__(( aligned(64) )), v2 __attribute__(( aligned(32) )), v3; 112 // struct S v4; 113 // 114 // v1 => 64, v2 =>32, v3 => 128, v2 => 128 115 // 116 // Anonymous aggregates are a special case because there is no aggregate to bind the attribute to; hence it floats 117 // to the declaration list. 118 // 119 // struct __attribute__(( aligned(128) )) /*anonymous */ { ... } v1; 120 // 121 // v1 => 128 122 123 bool copyattr = ! (typeSpec->type && typeSpec->type->kind == TypeData::Aggregate && ! typeSpec->type->aggregate.anon ); 124 125 // addType copies the type information for the aggregate instances from typeSpec into cl's aggInst.aggregate. 126 DeclarationNode * cl = (new DeclarationNode)->addType( typeSpec ); // typeSpec IS DELETED!!! 127 128 // Start at second variable in declaration list and clone the type specifiers for each variable.. 106 // printf( "distAttr1 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout ); 107 DeclarationNode * cl = (new DeclarationNode)->addType( typeSpec ); 108 // printf( "distAttr2 cl %p\n", cl ); cl->type->print( std::cout ); 109 // cl->type->aggregate.name = cl->type->aggInst.aggregate->aggregate.name; 110 129 111 for ( DeclarationNode * cur = dynamic_cast<DeclarationNode *>( declList->get_next() ); cur != nullptr; cur = dynamic_cast<DeclarationNode *>( cur->get_next() ) ) { 130 cl->cloneBaseType( cur , copyattr ); // cur is modified112 cl->cloneBaseType( cur ); 131 113 } // for 132 133 // Add first variable in declaration list with hidden type information in aggInst.aggregate, which is used by 134 // extractType to recover the type for the aggregate instances. 135 declList->addType( cl, copyattr ); // cl IS DELETED!!! 114 declList->addType( cl ); 115 // printf( "distAttr3 declList %p\n", declList ); declList->print( std::cout, 0 ); 136 116 return declList; 137 117 } // distAttr … … 212 192 fieldList = DeclarationNode::newName( nullptr ); 213 193 } // if 194 // return distAttr( typeSpec, fieldList ); // mark all fields in list 214 195 215 196 // printf( "fieldDecl3 typeSpec %p\n", typeSpec ); typeSpec->print( std::cout, 0 ); 216 DeclarationNode * temp = distAttr( typeSpec, fieldList ); // mark all fields in list197 DeclarationNode * temp = distAttr( typeSpec, fieldList ); // mark all fields in list 217 198 // printf( "fieldDecl4 temp %p\n", temp ); temp->print( std::cout, 0 ); 218 199 return temp; … … 780 761 | string_literal '`' identifier // CFA, postfix call 781 762 { $$ = new ExpressionNode( build_func( yylloc, new ExpressionNode( build_varref( yylloc, build_postfix_name( $3 ) ) ), $1 ) ); } 782 783 // SKULLDUGGERY: The typedef table used for parsing does not store fields in structures. To parse a qualified784 // name, it is assumed all name-tokens after the first are identifiers, regardless of how the lexer identifies785 // them. For example:786 //787 // struct S;788 // forall(T) struct T;789 // union U;790 // enum E { S, T, E };791 // struct Z { int S, T, Z, E, U; };792 // void fred () {793 // Z z;794 // z.S; // lexer returns S is TYPEDEFname795 // z.T; // lexer returns T is TYPEGENname796 // z.Z; // lexer returns Z is TYPEDEFname797 // z.U; // lexer returns U is TYPEDEFname798 // z.E; // lexer returns E is TYPEDEFname799 // }800 763 | postfix_expression '.' identifier 801 764 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); } 802 | postfix_expression '.' TYPEDEFname // CFA, SKULLDUGGERY803 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }804 | postfix_expression '.' TYPEGENname // CFA, SKULLDUGGERY805 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_varref( yylloc, $3 ) ) ); }806 807 765 | postfix_expression '.' INTEGERconstant // CFA, tuple index 808 766 { $$ = new ExpressionNode( build_fieldSel( yylloc, $1, build_constantInteger( yylloc, *$3 ) ) ); } … … 1897 1855 declaration_list: 1898 1856 declaration 1899 | declaration_list declaration { $$ = $1->appendList( $2 ); } 1857 | declaration_list declaration 1858 { $$ = $1->appendList( $2 ); } 1900 1859 ; 1901 1860 … … 1930 1889 declaration: // old & new style declarations 1931 1890 c_declaration ';' 1891 { 1892 // printf( "C_DECLARATION1 %p %s\n", $$, $$->name ? $$->name->c_str() : "(nil)" ); 1893 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 1894 // printf( "\tattr %s\n", attr->name.c_str() ); 1895 // } // for 1896 } 1932 1897 | cfa_declaration ';' // CFA 1933 1898 | static_assert // C11 … … 2382 2347 sue_declaration_specifier: // struct, union, enum + storage class + type specifier 2383 2348 sue_type_specifier 2349 { 2350 // printf( "sue_declaration_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2351 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2352 // printf( "\tattr %s\n", attr->name.c_str() ); 2353 // } // for 2354 } 2384 2355 | declaration_qualifier_list sue_type_specifier 2385 2356 { $$ = $2->addQualifiers( $1 ); } … … 2392 2363 sue_type_specifier: // struct, union, enum + type specifier 2393 2364 elaborated_type 2365 { 2366 // printf( "sue_type_specifier %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2367 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2368 // printf( "\tattr %s\n", attr->name.c_str() ); 2369 // } // for 2370 } 2394 2371 | type_qualifier_list 2395 2372 { if ( $1->type != nullptr && $1->type->forall ) forall = true; } // remember generic type … … 2464 2441 elaborated_type: // struct, union, enum 2465 2442 aggregate_type 2443 { 2444 // printf( "elaborated_type %p %s\n", $$, $$->type->aggregate.name ? $$->type->aggregate.name->c_str() : "(nil)" ); 2445 // for ( Attribute * attr: reverseIterate( $$->attributes ) ) { 2446 // printf( "\tattr %s\n", attr->name.c_str() ); 2447 // } // for 2448 } 2466 2449 | enum_type 2467 2450 ; … … 2695 2678 { $$ = DeclarationNode::newEnum( nullptr, $4, true, false )->addQualifiers( $2 ); } 2696 2679 | ENUM attribute_list_opt '!' '{' enumerator_list comma_opt '}' // invalid syntax rule 2697 { SemanticError( yylloc, "syntax error, hiding ('!')the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }2680 { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; } 2698 2681 | ENUM attribute_list_opt identifier 2699 2682 { typedefTable.makeTypedef( *$3, "enum_type 1" ); } … … 2710 2693 } 2711 2694 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // unqualified type name 2712 { SemanticError( yylloc, "syntax error, hiding ('!')the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }2695 { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; } 2713 2696 | ENUM '(' ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2714 2697 { … … 2716 2699 } 2717 2700 | ENUM '(' ')' attribute_list_opt '!' '{' enumerator_list comma_opt '}' // invalid syntax rule 2718 { SemanticError( yylloc, "syntax error, hiding ('!')the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; }2701 { SemanticError( yylloc, "syntax error, hiding '!' the enumerator names of an anonymous enumeration means the names are inaccessible." ); $$ = nullptr; } 2719 2702 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt identifier attribute_list_opt 2720 2703 { … … 3187 3170 // unit, which is a dubious task, especially because C uses name rather than structural typing; hence it is 3188 3171 // disallowed at the moment. 3189 if ( $1->linkage == ast::Linkage::Cforall && ! $1->storageClasses.is_static && 3190 $1->type && $1->type->kind == TypeData::AggregateInst ) { 3172 if ( $1->linkage == ast::Linkage::Cforall && ! $1->storageClasses.is_static && $1->type && $1->type->kind == TypeData::AggregateInst ) { 3191 3173 if ( $1->type->aggInst.aggregate->kind == TypeData::Enum && $1->type->aggInst.aggregate->enumeration.anon ) { 3192 3174 SemanticError( yylloc, "extern anonymous enumeration is currently unimplemented." ); $$ = nullptr; -
tests/.expect/attributes.x64.txt
r46aa60e r1761046 6 6 7 7 } 8 struct __a ttribute__ ((unused)) __anonymous0 {8 struct __anonymous0 { 9 9 }; 10 10 static inline void _X12_constructorFv_S12__anonymous0_autogen___1(struct __anonymous0 *_X4_dstS12__anonymous0_1); -
tests/errors/.expect/declaration.txt
r46aa60e r1761046 8 8 with members 9 9 i: int 10 with body10 with body 11 11 12 12 … … 14 14 with members 15 15 i: int 16 with body16 with body 17 17 18 18
Note:
See TracChangeset
for help on using the changeset viewer.