This call to ProhibitAttributes() is almost always dead code.
For GNU attributes, it always is, even though they are being used in explicit template instantiations in, e.g. in clang/test/CodeGenCXX/visibility.cpp:
#define DEFAULT __attribute__((visibility("default"))) namespace PR11690 { template<class T> struct Class { void size() const { } }; template class DEFAULT Class<char>; }
This code is accepted by current g++ and clang++, even though the code claims to reject it because of the attributes.
If the attributes are changed to C++ attributes however, clang++ _does_ reject it:
#define DEFAULT [[]] namespace PR11690 { template<class T> struct Class { void size() const { } }; template class DEFAULT Class<char>; }
But g++ still accepts the above code. Simply ignoring the attributes does not work either as it breaks tests (e.g. the visibility test from above).
I am not sure why or if GNU-style and C++ attributes should be handled differently here, so I am open for a discussion but this call seems mislead to me.
Thanks,
Timm