This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82193] incorrectly rejects int x; struct { decltype(x) x; } f = {x};
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Sep 2017 19:23:55 +0000
- Subject: [Bug c++/82193] incorrectly rejects int x; struct { decltype(x) x; } f = {x};
- Auto-submitted: auto-generated
- References: <bug-82193-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82193
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
[basic.scope.class] p2:
"A name N used in a class S shall refer to the same declaration in its context
and when re-evaluated in the completed scope of S. No diagnostic is required
for a violation of this rule."
So the code is ill-formed, no diagnostic required.
GCC is allowed to reject it. The other compilers fail to diagnose it (which is
also conforming).