[Bug c++/71222] [concepts] ill-formed code taking the address of a function concept not rejected
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 15 08:19:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71222
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The bug is still present on gcc-8-branch.
On gcc-9-branch there's an ICE:
71222.cc: In function 'int main()':
71222.cc:4:16: internal compiler error: in instantiate_decl, at cp/pt.c:24449
4 | auto fc = &FC<int>;
| ^~~~~~~
0x591eca instantiate_decl(tree_node*, bool, bool)
/home/jwakely/src/gcc/gcc-9/gcc/cp/pt.c:24449
With trunk it's correctly rejected:
71222.cc: In function 'int main()':
71222.cc:4:16: error: lvalue required as unary '&' operand
4 | auto fc = &FC<int>;
| ^~~~~~~
We should add the testcase (if there isn't something like it already) and close
this as FIXED.
More information about the Gcc-bugs
mailing list