public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message
@ 2020-08-05 22:45 khim at google dot com
2020-08-06 9:07 ` [Bug c++/96490] " redi at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: khim at google dot com @ 2020-08-05 22:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
Bug ID: 96490
Summary: Template code with function pointers fails with very
cryptic error message
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: khim at google dot com
Target Milestone: ---
The following code works with all other compilers: https://godbolt.org/z/Mv3xsn
template<typename T, T p>
class TagType;
int foo();
constexpr auto foo_ptr = &foo;
template<typename T>
int test();
int bar() {
return test<TagType<decltype(&foo), &foo>>();
}
int baz() {
return test<TagType<decltype(foo_ptr), foo_ptr>>();
But GCC reports very cryptic error:
could not convert template argument 'foo_ptr' from 'int (* const)()' to 'int (*
const)()'
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
@ 2020-08-06 9:07 ` redi at gcc dot gnu.org
2021-08-04 17:35 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2020-08-06 9:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-08-06
Ever confirmed|0 |1
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
2020-08-06 9:07 ` [Bug c++/96490] " redi at gcc dot gnu.org
@ 2021-08-04 17:35 ` pinskia at gcc dot gnu.org
2021-08-04 17:36 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04 17:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Seems fixed on the trunk.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
2020-08-06 9:07 ` [Bug c++/96490] " redi at gcc dot gnu.org
2021-08-04 17:35 ` pinskia at gcc dot gnu.org
@ 2021-08-04 17:36 ` pinskia at gcc dot gnu.org
2021-12-08 14:34 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04 17:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> Seems fixed on the trunk.
Maybe by the patch for PR 100893.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
` (2 preceding siblings ...)
2021-08-04 17:36 ` pinskia at gcc dot gnu.org
@ 2021-12-08 14:34 ` marxin at gcc dot gnu.org
2021-12-08 16:21 ` pinskia at gcc dot gnu.org
2021-12-08 16:21 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-08 14:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=100893
Keywords|needs-bisection |
CC| |marxin at gcc dot gnu.org,
| |ppalka at gcc dot gnu.org
--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed in r12-1224-g6f8c9691495ad5a3.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
` (3 preceding siblings ...)
2021-12-08 14:34 ` marxin at gcc dot gnu.org
@ 2021-12-08 16:21 ` pinskia at gcc dot gnu.org
2021-12-08 16:21 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-08 16:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
g++.dg/template/param4.C seems to cover the testcase here so closing as fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/96490] Template code with function pointers fails with very cryptic error message
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
` (4 preceding siblings ...)
2021-12-08 16:21 ` pinskia at gcc dot gnu.org
@ 2021-12-08 16:21 ` pinskia at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-08 16:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96490
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |12.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-12-08 16:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 22:45 [Bug c++/96490] New: Template code with function pointers fails with very cryptic error message khim at google dot com
2020-08-06 9:07 ` [Bug c++/96490] " redi at gcc dot gnu.org
2021-08-04 17:35 ` pinskia at gcc dot gnu.org
2021-08-04 17:36 ` pinskia at gcc dot gnu.org
2021-12-08 14:34 ` marxin at gcc dot gnu.org
2021-12-08 16:21 ` pinskia at gcc dot gnu.org
2021-12-08 16:21 ` pinskia 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).