[Bug c++/91746] Bogus error due to a type and variable with the same name

2019-09-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91746

--- Comment #2 from Andrew Pinski  ---
Just for refernce of the C++ standard wording:
[basic.scope.class] paragraph 2:

"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."

NOTE the "No dianostic is required" part.  So even though it is invalid to do
this, compilers don't need to check for volations.  If you want clang/MSVC to
detect the violation of this rule, please file a bug with them.

[Bug c++/91746] Bogus error due to a type and variable with the same name

2019-09-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91746

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
No GCC is correct. this is invalid C++ though there is no diagnostic required
by the C++ standard.   GCC checks for this case while the other two compilers
you citied don't.