public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102547] New: g++ 11. ICE with NTTPs and partial specialization
@ 2021-09-30 16:09 bob.steagall.cpp at gmail dot com
  2021-09-30 19:16 ` [Bug c++/102547] " ppalka at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: bob.steagall.cpp at gmail dot com @ 2021-09-30 16:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102547

            Bug ID: 102547
           Summary: g++ 11. ICE with NTTPs and partial specialization
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bob.steagall.cpp at gmail dot com
  Target Milestone: ---

The following C++ source code:

---------------------------------------------------------------------------

template<int... VALS>
struct vals {};


template<class V, class A>    
struct vals_client {};

template<int V0, int V1, typename A>
struct vals_client<vals<V0, V1>, A> {};

template<int V0, int V1>
struct vals_client<vals<V0, V1>, void> {};


void testfn()
{
    vals_client<vals<1, 2>, int>   ci;  //- OK
    vals_client<vals<1, 2>, void>  cv;  //- "sorry, unimplemented..., ICE" 
}

---------------------------------------------------------------------------

When compiled with gcc 11.X generates this error:


nttp_test.cpp: In function 'void testfn()':
nttp_test.cpp:18:36: sorry, unimplemented: unexpected AST of kind
nontype_argument_pack
   18 |     vals_client<vals<1, 2>, void>  cv;  //- "sorry, unimplemented..."
      |                                    ^~
nttp_test.cpp:18: confused by earlier errors, bailing out

---------------------------------------------------------------------------

When compiled with gcc trunk on godbolt.org, it elicits an ICE:

<source>: In function 'void testfn()':
<source>:23:36: sorry, unimplemented: unexpected AST of kind
nontype_argument_pack
   23 |     vals_client<vals<1, 2>, void>  cv;  //- "sorry, unimplemented...,
ICE"
      |                                    ^~
<source>:23:36: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.c:9051
0x1fe73f9 internal_error(char const*, ...)
        ???:0
0x7d40a7 fancy_abort(char const*, int, char const*)
        ???:0
0x8475ff potential_constant_expression(tree_node*)
        ???:0
0xa21bd7 instantiation_dependent_expression_p(tree_node*)
        ???:0
0xa21c46 uses_template_parms(tree_node*)
        ???:0
0xa72888 most_specialized_partial_spec(tree_node*, int)
        ???:0
0xa7f834 instantiate_class_template(tree_node*)
        ???:0
0x89e107 start_decl_1(tree_node*, bool)
        ???:0
0x8c552f start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ???:0
0xa08395 c_parse_file()
        ???:0
0xb8f562 c_common_parse_file()
        ???:0
Please submit a full bug report, ...

---------------------------------------------------------------------------

Testing with various version on godbolt.org reveals that the ICE does not 
occur with 10.X, 9.X, 8.X, or 7.X  (that's as far back as I went).

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-29 19:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 16:09 [Bug c++/102547] New: g++ 11. ICE with NTTPs and partial specialization bob.steagall.cpp at gmail dot com
2021-09-30 19:16 ` [Bug c++/102547] " ppalka at gcc dot gnu.org
2021-09-30 19:39 ` ppalka at gcc dot gnu.org
2021-09-30 19:41 ` [Bug c++/102547] [11/12 Regression] " ppalka at gcc dot gnu.org
2021-09-30 19:58 ` ppalka at gcc dot gnu.org
2021-09-30 21:35 ` bob.steagall.cpp at gmail dot com
2021-10-01  6:31 ` rguenth at gcc dot gnu.org
2021-10-05 19:36 ` cvs-commit at gcc dot gnu.org
2021-10-05 19:43 ` ppalka at gcc dot gnu.org
2021-10-05 19:44 ` [Bug c++/102547] [11 " ppalka at gcc dot gnu.org
2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:21 ` ppalka at gcc dot gnu.org
2021-10-29 19:43 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).