public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106289] New: Value of polymorphic type as template argument
@ 2022-07-13 23:16 johelegp at gmail dot com
0 siblings, 0 replies; only message in thread
From: johelegp at gmail dot com @ 2022-07-13 23:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106289
Bug ID: 106289
Summary: Value of polymorphic type as template argument
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/4jGn1fsc8.
```C++
struct B {
virtual ~B() = default;
};
template<auto> long y;
long z = y<B{}>;
```
```
<source>:6:10: error: '((& B::_ZTV1B) + 16)' is not a valid template argument
for 'int (**)(...)' because it is not the address of a variable
6 | long z = y<B{}>;
| ^~~~~~
Compiler returned: 1
```
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-13 23:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13 23:16 [Bug c++/106289] New: Value of polymorphic type as template argument johelegp 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).