https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80473
Bug ID: 80473 Summary: [7/8 Regression] notes about over-aligned new not suppressed in system-headers Product: gcc Version: 7.0.1 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> struct alignas(64) A { int i; }; constexpr bool b = std::is_constructible<A, A>::value; With -Wall this produces unhelpful output referring to an unevaluated new-expression inside libstdc++ internals: In file included from a2.cc:1:0: /home/jwakely/gcc/7/include/c++/7.0.1/type_traits: In substitution of ‘template<class _Tp, class _Arg> struct std::__is_direct_constructible_impl<_Tp, _Arg, decltype (::new _Tp)> [with _Tp = A; _Arg = A]’: /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:143:12: required from ‘struct std::__and_<std::is_destructible<A>, std::__is_direct_constructible_impl<A, A, void> >’ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:995:12: required from ‘struct std::__is_direct_constructible_new_safe<A, A>’ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:1077:12: required from ‘struct std::__is_direct_constructible_new<A, A>’ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:1085:12: required from ‘struct std::__is_direct_constructible<A, A>’ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:1125:12: required from ‘struct std::__is_constructible_impl<A, A>’ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:1136:12: required from ‘struct std::is_constructible<A, A>’ a2.cc:3:47: required from here /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:990:16: note: uses ‘void* operator new(long unsigned int)’, which does not have an alignment parameter decltype(::new _Tp(std::declval<_Arg>()))> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/jwakely/gcc/7/include/c++/7.0.1/type_traits:990:16: note: use ‘-faligned-new’ to enable C++17 over-aligned new support The actual -Waligned-new warning is suppressed due to being in a system header, but the note is not. It's debatable whether warning about the new-expression as an unevaluated operand is useful anyway, but the note should not be printed if the warning is suppressed.