https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84639
Bug ID: 84639 Summary: gcc/c-family/c-attribs.c:1822:27: runtime error: shift exponent -1 is negative Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org, mpolacek at gcc dot gnu.org, nathan at gcc dot gnu.org Target Milestone: --- UBSAN gcc prints the error: $ UBSAN_OPTIONS="print_stacktrace=1" ./xg++ -B. /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/alignas12.C /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/alignas12.C:6:10: error: ‘alignas’ argument has non-integral type ‘<unresolved overloaded function type>’ alignas (f < int >) char c; // { dg-error "non-integral type" } ^~~~~~~~~ ../../gcc/c-family/c-attribs.c:1822:27: runtime error: shift exponent -1 is negative #0 0x5e311c in common_handle_aligned_attribute ../../gcc/c-family/c-attribs.c:1822 #1 0xe29d06 in decl_attributes(tree_node**, tree_node*, int, tree_node*) ../../gcc/attribs.c:685 #2 0x991bd9 in cplus_decl_attributes(tree_node**, tree_node*, int) ../../gcc/cp/decl2.c:1546 #3 0x95790d in start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/cp/decl.c:5047 #4 0xb95381 in cp_parser_init_declarator ../../gcc/cp/parser.c:19587 #5 0xbaef4d in cp_parser_simple_declaration ../../gcc/cp/parser.c:13053 #6 0xbb230e in cp_parser_block_declaration ../../gcc/cp/parser.c:12878 #7 0xbc4460 in cp_parser_declaration ../../gcc/cp/parser.c:12776 #8 0xbc66a1 in cp_parser_declaration_seq_opt ../../gcc/cp/parser.c:12652 #9 0xbc7628 in cp_parser_translation_unit ../../gcc/cp/parser.c:4559 #10 0xbc7628 in c_parse_file() ../../gcc/cp/parser.c:38880 #11 0xeec35c in c_common_parse_file() ../../gcc/c-family/c-opts.c:1132 #12 0x25a2cdc in compile_file ../../gcc/toplev.c:455 #13 0x77e2e9 in do_compile ../../gcc/toplev.c:2132 #14 0x77e2e9 in toplev::main(int, char**) ../../gcc/toplev.c:2267 #15 0x78117a in main ../../gcc/main.c:39 #16 0x7fd52c3026e4 in __libc_start_main (/lib64/libc.so.6+0x206e4) #17 0x7812a8 in _start (/home/marxin/Programming/gcc/objdir/gcc/cc1plus+0x7812a8)