-
- Downloads
c++: Disable -Wignored-qualifiers for template args [PR107492]
It seems wrong to issue a -Wignored-qualifiers warning for code like: static_assert(!is_same_v<void(*)(), const void(*)()>); because there the qualifier matters. Likewise in template specialization: template<typename T> struct S { }; template<> struct S<void(*)()> { }; template<> struct S<const void(*)()> { }; // OK, not a redefinition And likewise in other type-id contexts such as trailing-return-type: auto g() -> const void (*)(); This patch limits the warning to the function declaration context only. PR c++/107492 gcc/cp/ChangeLog: * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning when funcdecl_p. gcc/testsuite/ChangeLog: * g++.dg/warn/Wignored-qualifiers3.C: New test.
Please register or sign in to comment