This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/80390] std::pair of aligned type gives bogus warning
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Apr 2017 13:41:31 +0000
- Subject: [Bug libstdc++/80390] std::pair of aligned type gives bogus warning
- Auto-submitted: auto-generated
- References: <bug-80390-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80390
--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Created attachment 41235 [details]
> avoid over-aligned new in is_constructible
>
> [..]. We can also combine it
> with the delete check, because PR 51222 is fixed.
It seems that PR 51222 didn't cover private destructors. Using this test class
struct PS
{
PS(int);
private:
~PS() = default;
};
The attempt to evaluate the revised __is_direct_constructible_impl<PS, int>
produces a compiler error (so not SFINAE-friendly), but the current
implementation (using std::is_destructible) works nicely.
Do you recommend to reopen 51222 or should I open a separate bug? I'm inclined
to create a new one at the moment.
Another question I have is the following: What is you main motivation to
introduce the idiom
struct __uneval_new_t;
inline void* operator new(std::size_t, std::__uneval_new_t*);
decltype(::delete ::new((__uneval_new_t*)0) _Tp(std::declval<_Arg>()))
compared to the seemingly simpler alternative
decltype(::delete ::new _Tp(std::declval<_Arg>()))
?