Changeset ae2f2ae
- Timestamp:
- Jun 22, 2022, 12:59:43 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 1158180
- Parents:
- c19edd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Parser/parser.yy ¶
rc19edd1 rae2f2ae 56 56 57 57 #include "SynTree/Attribute.h" // for Attribute 58 59 // lex uses __null in a boolean context, it's fine. 60 #pragma GCC diagnostic ignored "-Wparentheses-equality" 58 61 59 62 extern DeclarationNode * parseTree; … … 1240 1243 { 1241 1244 $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); 1242 SemanticWarning( yylloc, Warning::SuperfluousElse );1245 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1243 1246 } 1244 1247 | WHILE '(' conditional_declaration ')' statement %prec THEN … … 1251 1254 { 1252 1255 $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); 1253 SemanticWarning( yylloc, Warning::SuperfluousElse );1256 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1254 1257 } 1255 1258 | DO statement WHILE '(' comma_expression ')' ';' … … 1262 1265 { 1263 1266 $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); 1264 SemanticWarning( yylloc, Warning::SuperfluousElse );1267 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1265 1268 } 1266 1269 | FOR '(' for_control_expression_list ')' statement %prec THEN … … 2394 2397 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2395 2398 { 2396 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2399 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2397 2400 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2398 2401 … … 2841 2844 linkage = LinkageSpec::update( yylloc, linkage, $2 ); 2842 2845 } 2843 up external_definition down 2846 up external_definition down 2844 2847 { 2845 2848 linkage = linkageStack.top();
Note: See TracChangeset
for help on using the changeset viewer.