https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106143
Bug ID: 106143 Summary: Add fix-it for missing ::value on trait with std::integral_constant base Product: gcc Version: unknown Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- #include <type_traits> static_assert( std::is_void<void>, "void is void is void" ); constexpr bool b = std::is_void<void>; v.C:2:34: error: expected primary-expression before ',' token 2 | static_assert( std::is_void<void>, "void is void is void" ); | ^ v.C:3:38: error: expected primary-expression before ';' token 3 | constexpr bool b = std::is_void<void>; | ^ I do this all the time: forget to take the ::value of the trait and just use the type itself. The diagnostic could be improved for this case, by detecting that the type has a base that is a specialization of std::integral_constant and suggesting adding ::value as a fix-it: v.C:2:34: error: expected primary-expression before ',' token 2 | static_assert( std::is_void<void>, "void is void is void" ); | ^ | ::value v.C:3:38: error: expected primary-expression before ';' token 3 | constexpr bool b = std::is_void<void>; | ^ | ::value