[Bug c++/86301] g++ does not mark declarations used in non-dependent types as referenced

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 25 11:12:00 GMT 2018


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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The link I gave explains that such code is ill-formed, no diagnostic required.

See https://en.cppreference.com/w/cpp/language/ub for an explanation.

That means the compiler is not required to give an error. So it is not a bug in
GCC and not a bug in Clang.


More information about the Gcc-bugs mailing list