File tree Expand file tree Collapse file tree 4 files changed +32
-2
lines changed
regression/cpp/gcc_attributes2 Expand file tree Collapse file tree 4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1+ #ifdef __GNUC__
2+ typedef int my_int16_t __attribute__ ((__mode__(__HI__)));
3+ static_assert (sizeof (my_int16_t ) == 2 , " 16 bit" );
4+ #endif
5+
6+ int main ()
7+ {
8+ return 0 ;
9+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.cpp
3+ -std=c++11
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ --
7+ ^warning: ignoring
8+ ^CONVERSION ERROR$
Original file line number Diff line number Diff line change @@ -272,6 +272,10 @@ void cpp_typecheckt::typecheck_type(typet &type)
272272 {
273273 c_typecheck_baset::typecheck_type (type);
274274 }
275+ else if (type.id () == ID_gcc_attribute_mode)
276+ {
277+ c_typecheck_baset::typecheck_type (type);
278+ }
275279 else
276280 {
277281 error ().source_location =type.source_location ();
Original file line number Diff line number Diff line change @@ -2262,7 +2262,7 @@ bool Parser::rAttribute(typet &t)
22622262
22632263 typet attr (ID_gcc_attribute_mode);
22642264 set_location (attr, tk);
2265- attr.set (ID_size, name. get (ID_identifier ));
2265+ attr.set (ID_size, to_cpp_name ( name). get_base_name ( ));
22662266 merge_types (attr, t);
22672267 break ;
22682268 }
@@ -2880,7 +2880,7 @@ bool Parser::rDeclaratorWithInit(
28802880 bit_field_type.subtype ().make_nil ();
28812881 set_location (bit_field_type, tk);
28822882
2883- // merge_types(bit_field_type, declarator .type());
2883+ merge_types (bit_field_type, dw .type ());
28842884
28852885 return true ;
28862886 }
@@ -3226,6 +3226,15 @@ bool Parser::rDeclarator(
32263226 }
32273227
32283228 optCvQualify (d_outer);
3229+ if (d_outer.is_not_nil () && !d_outer.has_subtypes ())
3230+ {
3231+ merged_typet merged_type;
3232+ merged_type.move_to_subtypes (d_outer);
3233+ typet nil;
3234+ nil.make_nil ();
3235+ merged_type.move_to_sub (nil);
3236+ d_outer.swap (merged_type);
3237+ }
32293238
32303239#ifdef DEBUG
32313240 std::cout << std::string (__indent, ' ' ) << " Parser::rDeclarator2 13\n " ;
You can’t perform that action at this time.
0 commit comments