https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69836

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> I wonder if this is just invalid code but no diagnostic required as state
> changes inside the scope of TemplateObject.

That is it needs to be reinterpret it after the parsing and needs to same
inside the scope itself. Like types of the same name should stay the same if
used inside the class.

Like:

typedef int t;
class y
{
  typedef t u;
  typedef float t;
};
Which GCC only handles currently:
<source>:5:17: error: declaration of 'typedef float y::t' changes meaning of
't' [-fpermissive]
    5 |   typedef float t;
      |                 ^
<source>:1:13: note: 't' declared here as 'typedef int t'
    1 | typedef int t;
      |             ^

Reply via email to