public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type.
@ 2020-12-06 14:31 leni536 at gmail dot com
2020-12-07 4:13 ` [Bug c++/98163] " mpolacek at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: leni536 at gmail dot com @ 2020-12-06 14:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98163
Bug ID: 98163
Summary: ICE symtab_node::verify failed, auto& NTTP specialized
with same entity but different type.
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: leni536 at gmail dot com
Target Milestone: ---
g++ (Compiler-Explorer-Build) 11.0.0 20201205 (experimental)
command line flags: -std=c++17 -pedantic-errors
```
template <auto& ref>
struct S {};
template <typename T>
void foo(T) {}
extern const int arr[];
// arr is const int[]
void bar(S<arr> s) {
foo(s);
}
const int arr[2] = {1,2};
// arr is const int[2]
void baz(S<arr> s) {
foo(s);
}
```
source>:19:1: error: Two symbols with same comdat_group are not linked by the
same_comdat_group list.
19 | }
| ^
_Z3fooI1SIL_Z3arrEEEvT_/4 (void foo(T) [with T = S<arr>]) @0x7f7216d81330
Type: function definition analyzed
Visibility: no_reorder public weak comdat
comdat_group:_Z3fooI1SIL_Z3arrEEEvT_ one_only
previous sharing asm name: 3
References:
Referring:
Function flags: body
Called by: _Z3baz1SIL_Z3arrEE/2
Calls:
_Z3fooI1SIL_Z3arrEEEvT_/3 (void foo(T) [with T = S<arr>]) @0x7f7216d81220
Type: function definition analyzed
Visibility: no_reorder public weak comdat
comdat_group:_Z3fooI1SIL_Z3arrEEEvT_ one_only
next sharing asm name: 4
References:
Referring:
Function flags: body
Called by: _Z3bar1SIL_Z3arrEE/0
Calls:
<source>:19:1: internal compiler error: symtab_node::verify failed
0x1c39f09 internal_error(char const*, ...)
???:0
0xacca22 symtab_node::verify_symtab_nodes()
???:0
0xae8def symbol_table::finalize_compilation_unit()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
godbolt: https://godbolt.org/z/bKc1c1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/98163] ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type.
2020-12-06 14:31 [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type leni536 at gmail dot com
@ 2020-12-07 4:13 ` mpolacek at gcc dot gnu.org
2020-12-07 10:23 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-12-07 4:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98163
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Probably a dup of bug 91241.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/98163] ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type.
2020-12-06 14:31 [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type leni536 at gmail dot com
2020-12-07 4:13 ` [Bug c++/98163] " mpolacek at gcc dot gnu.org
@ 2020-12-07 10:23 ` marxin at gcc dot gnu.org
2020-12-07 10:26 ` marxin at gcc dot gnu.org
2020-12-07 21:22 ` leni536 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-07 10:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98163
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org,
| |marxin at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2020-12-07
Status|UNCONFIRMED |NEW
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
This one started with r7-4431-g4a826ca6feb3c7ec, it was rejected before that:
pr98163.C:1:17: error: ‘auto’ parameter not permitted in this context
template <auto& ref>
^~~
pr98163.C:10:15: note: invalid template non-type parameter
void bar(S<arr> s) {
^
pr98163.C:17:15: note: invalid template non-type parameter
void baz(S<arr> s) {
^
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/98163] ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type.
2020-12-06 14:31 [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type leni536 at gmail dot com
2020-12-07 4:13 ` [Bug c++/98163] " mpolacek at gcc dot gnu.org
2020-12-07 10:23 ` marxin at gcc dot gnu.org
@ 2020-12-07 10:26 ` marxin at gcc dot gnu.org
2020-12-07 21:22 ` leni536 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-07 10:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98163
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
and without the checking one gets an assembler error:
$ g++ pr98163.C -c -std=c++17 -pedantic-errors
/tmp/cclBTXg2.s: Assembler messages:
/tmp/cclBTXg2.s:70: Error: symbol `_Z3fooI1SIL_Z3arrEEEvT_' is already defined
so the checking really makes sense.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/98163] ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type.
2020-12-06 14:31 [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type leni536 at gmail dot com
` (2 preceding siblings ...)
2020-12-07 10:26 ` marxin at gcc dot gnu.org
@ 2020-12-07 21:22 ` leni536 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: leni536 at gmail dot com @ 2020-12-07 21:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98163
--- Comment #4 from Lénárd Szolnoki <leni536 at gmail dot com> ---
Other example in the same spirit, but not using array of unknown bound:
```
template <auto&>
struct S {};
template <typename T>
void foo(T) {}
int i;
constexpr const int& iref = i;
template void foo(S<i>);
template void foo(S<iref>);
```
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-12-07 21:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-06 14:31 [Bug c++/98163] New: ICE symtab_node::verify failed, auto& NTTP specialized with same entity but different type leni536 at gmail dot com
2020-12-07 4:13 ` [Bug c++/98163] " mpolacek at gcc dot gnu.org
2020-12-07 10:23 ` marxin at gcc dot gnu.org
2020-12-07 10:26 ` marxin at gcc dot gnu.org
2020-12-07 21:22 ` leni536 at gmail dot com
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).