[Bug c++/80473] [7/8 Regression] notes about over-aligned new not suppressed in system-headers

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 20 14:59:00 GMT 2017


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This doesn't even depend on system headers, the following prints 18 lines of
notes and location info (but no warnings) when -w is used:

template<typename T> T&& declval();

template<typename T, typename U, typename = void>
struct is_constructible { enum { value = 0 }; };

template<typename T, typename U>
struct is_constructible<T, U, decltype(::new T(declval<U>()), void())>
{ enum { value = 1 }; };

struct alignas(64) A { int i; };

constexpr bool b = is_constructible<A, A>::value;


a3.cc: In substitution of ‘template<class T, class U> struct
is_constructible<T, U, decltype ((::new T, void()))> [with T = A; U = A]’:
a3.cc:12:42:   required from here
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
 struct is_constructible<T, U, decltype(::new T(declval<U>()), void())>
                                        ^~~~~~~~~~~~~~~~~~~~~
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
a3.cc: In instantiation of ‘struct is_constructible<A, A>’:
a3.cc:12:42:   required from here
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support
a3.cc:7:40: note: uses ‘void* operator new(long unsigned int)’, which does not
have an alignment parameter
a3.cc:7:40: note: use ‘-faligned-new’ to enable C++17 over-aligned new support


More information about the Gcc-bugs mailing list