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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to linuxnyasha from comment #6)
> (In reply to Andrew Pinski from comment #5)
> > (In reply to linuxnyasha from comment #2)
> > > On clang works
> > 
> > But 2 out of 3 compilers have the same error message which might mean this
> > is not valid code. with and without optimizations in GCC in this case
> > usually means it depends on when the decl is injected depending which
> > template gets instantiated first.
> 
> I think the way gcc works with optimizations is more correct. Clang works
> the same way. My project depends on this, so I would like it to either
> remain unchanged, or for it to always work as if with optimizations. Well, I
> consider the way clang works to be a higher priority than msvc.


But it all depends on what the standard thinks here rather than depending on
what clang or msvc does. As I mentioned the standard most likely says this is
invalid code and no diagnostic is required which means all compilers and gcc at
different optimization levels is correct.

Your project depending on invalid c++ is not gcc fault though.

Reply via email to