public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59284] New: missing diagnostic on incomplete type at the point of template definition
@ 2013-11-25 11:17 vanyacpp at gmail dot com
2023-02-03 23:49 ` [Bug c++/59284] " pinskia at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: vanyacpp at gmail dot com @ 2013-11-25 11:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59284
Bug ID: 59284
Summary: missing diagnostic on incomplete type at the point of
template definition
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vanyacpp at gmail dot com
According to [temp.res]p8 this code is invalid, but gcc don't show error on it:
struct x;
template <typename T>
void f()
{
x x;
}
"If a type used in a non-dependent name is incomplete at the point at which a
template is defined but is complete at the point at which an instantiation is
done, and if the completeness of that type affects whether or not the program
is well-formed or affects the semantics of the program, the program is
ill-formed; no diagnostic is required."
clang gives error:
19.cpp:7:7: error: variable has incomplete type 'x'
x x;
^
19.cpp:2:8: note: forward declaration of 'x'
struct x;
^
1 error generated.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-03 23:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-25 11:17 [Bug c++/59284] New: missing diagnostic on incomplete type at the point of template definition vanyacpp at gmail dot com
2023-02-03 23:49 ` [Bug c++/59284] " 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).