This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for constexpr variable templates


I can confirm that this is caused by a change to pt.c that happened, I think, the day before my last patch.

This can be fixed by first checking that the template is a function template at that line in pt.c. Since variable templates can't be friends, it might also be suitable to skip that entire block if it is a function template.

Should I submit that as a patch?

- Braden Obrzut

On 08/05/2014 04:06 PM, Paolo Carlini wrote:
Hi,

On 08/05/2014 08:26 PM, Jason Merrill wrote:
Applied with a few formatting/comment tweaks, thanks!
Great. I will double check but var-templ4.C fails for me with an ICE. Can anybody reproduce?

Thanks!
Paolo.

////////////////

/.../gcc/testsuite/g++.dg/cpp1y/var-templ4.C:8:17: internal compiler error: tree check: expected function_decl, have var_decl in check_explicit_specialization, at cp/pt.c:2822 0xde05a4 tree_check_failed(tree_node const*, char const*, int, char const*, ...)
    ../../trunk/gcc/tree.c:9174
0x5f9dd9 tree_check(tree_node*, char const*, int, char const*, tree_code)
    ../../trunk/gcc/tree.h:2729
0x5f9dd9 check_explicit_specialization(tree_node*, tree_node*, int, int)
    ../../trunk/gcc/cp/pt.c:2822
0x5af6e1 grokvardecl
    ../../trunk/gcc/cp/decl.c:8079
0x5af6e1 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**)
    ../../trunk/gcc/cp/decl.c:10918
0x5b24b4 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**)
    ../../trunk/gcc/cp/decl.c:4572
0x68ff5f cp_parser_init_declarator
    ../../trunk/gcc/cp/parser.c:16920
0x690b0a cp_parser_single_declaration
    ../../trunk/gcc/cp/parser.c:23494
0x69160d cp_parser_explicit_specialization
    ../../trunk/gcc/cp/parser.c:14418
0x69bfaf cp_parser_declaration
    ../../trunk/gcc/cp/parser.c:11152
0x69ab18 cp_parser_declaration_seq_opt
    ../../trunk/gcc/cp/parser.c:11085
0x69c3b3 cp_parser_translation_unit
    ../../trunk/gcc/cp/parser.c:4061
0x69c3b3 c_parse_file()
    ../../trunk/gcc/cp/parser.c:31954
0x7c0712 c_common_parse_file()
    ../../trunk/gcc/c-family/c-opts.c:1115


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]