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

--- Comment #1 from Sam James <sam at gentoo dot org> ---
Created attachment 53275
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53275&action=edit
ccHXKhJc.ii (minimised reproducer)

I think I need to re-run cvise because the minimised version doesn't build with
Clang, but the original does.

For the reduced version:
```
$ g++ -c ccHXKhJc.ii
ccHXKhJc.ii: In static member function ‘static bool
TypeParameterizedTest<TestSel>::Register()’:
ccHXKhJc.ii:19:67: warning: no return statement in function returning non-void
[-Wreturn-type]
   19 |   static bool Register() { new typename TestSel::Bind<int>::type; }
      |                                                                   ^
ccHXKhJc.ii: In static member function ‘static bool
TypeParameterizedTestSuite<Tests>::Register()’:
ccHXKhJc.ii:24:3: warning: no return statement in function returning non-void
[-Wreturn-type]
   24 |   }
      |   ^
ccHXKhJc.ii: In instantiation of ‘void atomic_fetch_flip_basic(Op) [with
<template-parameter-1-1> = int; <template-parameter-1-2> = short int; Op =
with_order<int>]’:
ccHXKhJc.ii:49:47:   required from ‘void BasicRelaxed< <template-parameter-1-1>
>::TestBody() [with <template-parameter-1-1> = int]’
ccHXKhJc.ii:47:6:   required from here
ccHXKhJc.ii:39:3: internal compiler error: in pop_local_binding, at
cp/name-lookup.cc:2474
   39 |   for (ref_ atomic : array<Size>{})
      |   ^~~
0x72069f pop_local_binding(tree_node*, tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/name-lookup.cc:2474
0x72069f poplevel(int, int, int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl.cc:733
0x13a626c do_poplevel(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:640
0x14f98c5 finish_for_stmt(tree_node*)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/semantics.cc:1399
0x15c481e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18768
0x15c428b tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18507
0x15c41f4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:18864
0x163cc24 instantiate_body
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26466
0x163ab56 instantiate_decl(tree_node*, bool, bool)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26758
0x1309d40 instantiate_pending_templates(int)
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/pt.cc:26837
0x1302380 c_parse_final_cleanups()
       
/usr/src/debug/sys-devel/gcc-12.1.1_p20220702/gcc-12-20220702/gcc/cp/decl2.cc:5128
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

Reply via email to