Bug 79711 - [concepts] ICE in instantiate_decl, at cp/pt.c:22474
Summary: [concepts] ICE in instantiate_decl, at cp/pt.c:22474
Status: RESOLVED DUPLICATE of bug 71222
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: concepts
  Show dependency treegraph
 
Reported: 2017-02-25 17:40 UTC by Hubert Tong
Modified: 2021-08-10 00:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-10-19 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hubert Tong 2017-02-25 17:40:32 UTC
### Source (<stdin>):
template <typename T>
concept bool f() { return true; }

static_assert((&f<int>)());

### Compiler invocation:
g++ -std=c++1z -fconcepts -c -o /dev/null -x c++ -

### Compiler output:
<stdin>:4:24: internal compiler error: in instantiate_decl, at cp/pt.c:22474
0x5d463c instantiate_decl(tree_node*, bool, bool)
        ../../source/gcc/cp/pt.c:22474
0x6d05c5 cxx_eval_call_expression
        ../../source/gcc/cp/constexpr.c:1493
0x6d15f5 cxx_eval_constant_expression
        ../../source/gcc/cp/constexpr.c:3973
0x6d55c4 cxx_eval_outermost_constant_expr
        ../../source/gcc/cp/constexpr.c:4615
0x6d7296 maybe_constant_value(tree_node*, tree_node*)
        ../../source/gcc/cp/constexpr.c:4830
0x683231 finish_static_assert(tree_node*, tree_node*, unsigned int, bool)
        ../../source/gcc/cp/semantics.c:8806
0x6379b9 cp_parser_static_assert
        ../../source/gcc/cp/parser.c:13646
0x649d3e cp_parser_block_declaration
        ../../source/gcc/cp/parser.c:12617
0x628484 cp_parser_declaration
        ../../source/gcc/cp/parser.c:12518
0x64e00b cp_parser_declaration_seq_opt
        ../../source/gcc/cp/parser.c:12394
0x64e2f2 cp_parser_translation_unit
        ../../source/gcc/cp/parser.c:4366
0x64e2f2 c_parse_file()
        ../../source/gcc/cp/parser.c:38440
0x71c483 c_common_parse_file()
        ../../source/gcc/c-family/c-opts.c:1107
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 version info (g++ -v):
Using built-in specs.
COLLECT_GCC=/opt/wandbox/gcc-head/bin/g++
COLLECT_LTO_WRAPPER=/opt/wandbox/gcc-head/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../source/configure --prefix=/opt/wandbox/gcc-head --enable-languages=c,c++ --disable-multilib --without-ppl --without-cloog-ppl --enable-checking=release --disable-nls --enable-lto LDFLAGS=-Wl,-rpath,/opt/wandbox/gcc-head/lib,-rpath,/opt/wandbox/gcc-head/lib64,-rpath,/opt/wandbox/gcc-head/lib32
Thread model: posix
gcc version 7.0.1 20170224 (experimental) (GCC)
Comment 1 Andrew Pinski 2021-07-19 00:02:00 UTC
On the trunk we get:
t65.cc:4:17: error: lvalue required as unary ‘&’ operand
    4 | static_assert((&f<int>)());
      |                 ^~~~~~
Comment 2 Andrew Pinski 2021-08-10 00:42:41 UTC
Dup of bug 71222.

*** This bug has been marked as a duplicate of bug 71222 ***