Changeset 8a78dd3
- Timestamp:
- Nov 27, 2017, 4:17:28 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 8a0a64d9
- Parents:
- 56de6b39 (diff), a16a7ec (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r56de6b39 r8a78dd3 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 20 09:45:36 201713 // Update Count : 29 4512 // Last Modified On : Sun Nov 26 11:36:36 2017 13 // Update Count : 2969 14 14 // 15 15 … … 345 345 %type<en> type_list 346 346 347 %type<decl> type_qualifier type_qualifier_name type_qualifier_list_opt type_qualifier_list347 %type<decl> type_qualifier type_qualifier_name forall type_qualifier_list_opt type_qualifier_list 348 348 %type<decl> type_specifier type_specifier_nobody 349 349 … … 379 379 // `---' matches start of TYPEGENname '(' 380 380 // Must be: 381 // Foo( int ) ( *fp )( int );381 // Foo( int ) ( *fp )( int ); 382 382 383 383 // Order of these lines matters (low-to-high precedence). … … 1058 1058 with_statement: 1059 1059 WITH '(' tuple_expression_list ')' statement 1060 { $$ = nullptr; }// FIX ME1060 { throw SemanticError("With clause is currently unimplemented."); $$ = nullptr; } // FIX ME 1061 1061 ; 1062 1062 … … 1064 1064 mutex_statement: 1065 1065 MUTEX '(' argument_expression_list ')' statement 1066 { $$ = nullptr; }// FIX ME1066 { throw SemanticError("Mutex statement is currently unimplemented."); $$ = nullptr; } // FIX ME 1067 1067 ; 1068 1068 … … 1280 1280 c_declaration pop ';' 1281 1281 | cfa_declaration pop ';' // CFA 1282 | STATICASSERT '(' constant_expression ',' string_literal ')' ';' // C11 1283 { throw SemanticError("Static assert is currently unimplemented."); $$ = nullptr; } // FIX ME 1282 1284 ; 1283 1285 … … 1587 1589 | ATOMIC 1588 1590 { $$ = DeclarationNode::newTypeQualifier( Type::Atomic ); } 1589 | FORALL '(' 1591 | forall 1592 ; 1593 1594 forall: 1595 FORALL '(' 1590 1596 { 1591 1597 typedefTable.enterScope(); … … 2374 2380 $$ = $2; 2375 2381 } 2382 | forall '{' external_definition_list '}' // CFA, namespace 2376 2383 ; 2377 2384 … … 2399 2406 with_clause_opt: 2400 2407 // empty 2401 { $$ = nullptr; } // FIX ME2408 { $$ = nullptr; } 2402 2409 | WITH '(' tuple_expression_list ')' 2403 { $$ = nullptr; }// FIX ME2410 { throw SemanticError("With clause is currently unimplemented."); $$ = nullptr; } // FIX ME 2404 2411 ; 2405 2412 … … 2418 2425 $$ = $2->addFunctionBody( $4 )->addType( $1 ); 2419 2426 } 2427 // handles default int return type, OBSOLESCENT (see 1) 2420 2428 | type_qualifier_list function_declarator with_clause_opt compound_statement 2421 2429 { … … 2424 2432 $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 ); 2425 2433 } 2434 // handles default int return type, OBSOLESCENT (see 1) 2426 2435 | declaration_qualifier_list function_declarator with_clause_opt compound_statement 2427 2436 { … … 2430 2439 $$ = $2->addFunctionBody( $4 )->addQualifiers( $1 ); 2431 2440 } 2441 // handles default int return type, OBSOLESCENT (see 1) 2432 2442 | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement 2433 2443 { … … 2445 2455 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addType( $1 ); 2446 2456 } 2457 // handles default int return type, OBSOLESCENT (see 1) 2447 2458 | type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2448 2459 { … … 2451 2462 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addQualifiers( $1 ); 2452 2463 } 2453 2454 // Old-style K&R function definition with "implicit int" type_specifier, OBSOLESCENT (see 4) 2464 // handles default int return type, OBSOLESCENT (see 1) 2455 2465 | declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2456 2466 { … … 2459 2469 $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5 )->addQualifiers( $1 ); 2460 2470 } 2471 // handles default int return type, OBSOLESCENT (see 1) 2461 2472 | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement 2462 2473 { -
src/tests/polymorphism.c
r56de6b39 r8a78dd3 47 47 S s; 48 48 s.i = i; 49 assert (s.i == i);49 assertf(s.i == i, "struct operation fails in polymorphic context."); 50 50 51 51 B b; … … 73 73 { 74 74 // test aggregates with polymorphic members 75 typedef uint32_t x_type;76 typedef uint64_t y_type;75 typedef __attribute__((aligned(8))) uint32_t x_type; 76 typedef __attribute__((aligned(8))) uint64_t y_type; 77 77 78 78 x_type x = 3; … … 89 89 // ensure that the size of aggregates with polymorphic members 90 90 // matches the size of the aggregates in a monomorphic context 91 assert ( struct_size(x, y) == sizeof(S));92 assert ( union_size(x, y) == sizeof(U));91 assertf( struct_size(x, y) == sizeof(S), "struct size differs in polymorphic context." ); 92 assertf( union_size(x, y) == sizeof(U), "union size differs in polymorphic context." ); 93 93 94 94 y_type ?=?(y_type & this, zero_t) { … … 111 111 u.f2 = 0; 112 112 u.f1 = x; 113 assert (ret == u.f2);113 assertf(ret == u.f2, "union operation fails in polymorphic context."); 114 114 } 115 115 }
Note: See TracChangeset
for help on using the changeset viewer.