This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36871] __has_nothrow_copy(T) false for T with a template ctor
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2008 00:44:08 -0000
- Subject: [Bug c++/36871] __has_nothrow_copy(T) false for T with a template ctor
- References: <bug-36871-1186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from sebor at roguewave dot com 2008-07-19 00:44 -------
This also fails. Seems that the combination of a copy ctor and template ctor
(even non-throwing) trips the compiler up.
$ cat u.cpp && g++ u.cpp -std=c++0x && ./a.out
#include <cassert>
#include <type_traits>
struct F {
F (const F&) throw () { }
template <class T> F (T) throw () { }
};
int main ()
{
assert (std::has_nothrow_copy_constructor<F>::value);
assert (__has_nothrow_copy (F));
}
a.out: u.cpp:12: int main(): Assertion
`std::has_nothrow_copy_constructor<F>::value' failed.
Aborted
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36871