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

--- Comment #5 from Stephan Bergmann <sbergman at redhat dot com> ---
(In reply to Stephan Bergmann from comment #4)
> So users will have to be careful when they fix a -Wredundant-tags warning in
> an included file.  They may have to introduce a forward declaration into the
> included file

...or use a qualified name like "::S" as would be necessary in the example
below...

> in order not to break (or silently alter) other translation
> units that also include that file.  (A case where removal of the "redundant"
> tag in the included file inc.h
> 
> > struct S {};
> > namespace N {
> >   int f(struct S); // -Wredundant-tags
> > }
> 
> can silently alter the behavior of another translation unit is when that
> other translation unit contains
> 
> > namespace N { int S = 0; }
> > #include "inc.h"
> 
> so that N::f would now be a variable rather than a function there.)

Reply via email to