https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80244
Bug ID: 80244 Summary: [6/7 Regression] ICE with attribute in template alias Product: gcc Version: 7.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following code snippet triggers an ICE since GCC 6.1.0: ====================================================================== template<typename> struct A {}; template<typename T> using B = A<__underlying_type(T) [[gnu::aligned(4)]]>; ====================================================================== bug.cc:3:67: internal compiler error: in layout_type, at stor-layout.c:2386 template<typename T> using B = A<__underlying_type(T) [[gnu::aligned(4)]]>; ^ 0xd5a9bf layout_type(tree_node*) ../../gcc/gcc/stor-layout.c:2386 0x1027845 type_hash_canon(unsigned int, tree_node*) ../../gcc/gcc/tree.c:7131 0x1027d2d build_type_attribute_qual_variant(tree_node*, tree_node*, int) ../../gcc/gcc/tree.c:4875 0x7ce47d cp_build_type_attribute_variant(tree_node*, tree_node*) ../../gcc/gcc/cp/tree.c:4156 0x7dd9f2 strip_typedefs(tree_node*, bool*) ../../gcc/gcc/cp/tree.c:1580 0x6478ac canonicalize_type_argument ../../gcc/gcc/cp/pt.c:7331 0x68db53 coerce_template_parms ../../gcc/gcc/cp/pt.c:8128 0x6947ea lookup_template_class_1 ../../gcc/gcc/cp/pt.c:8664 0x6947ea lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ../../gcc/gcc/cp/pt.c:9009 0x7a7a8d finish_template_type(tree_node*, tree_node*, int) ../../gcc/gcc/cp/semantics.c:3151 0x7308f4 cp_parser_template_id ../../gcc/gcc/cp/parser.c:15491 0x730b0f cp_parser_class_name ../../gcc/gcc/cp/parser.c:21949 0x72d572 cp_parser_qualifying_entity ../../gcc/gcc/cp/parser.c:6285 0x72d572 cp_parser_nested_name_specifier_opt ../../gcc/gcc/cp/parser.c:5971 0x732b23 cp_parser_simple_type_specifier ../../gcc/gcc/cp/parser.c:16822 0x7208ad cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:16495 0x72f1e2 cp_parser_type_specifier_seq ../../gcc/gcc/cp/parser.c:20777 0x724e61 cp_parser_type_id_1 ../../gcc/gcc/cp/parser.c:20623 0x72c4f0 cp_parser_type_id ../../gcc/gcc/cp/parser.c:20693 0x72c4f0 cp_parser_alias_declaration ../../gcc/gcc/cp/parser.c:18589 Please submit a full bug report, [etc.] In GCC 5 and before the code was accepted.