Open Quuxplusone opened 9 years ago
Bugzilla Link | PR23383 |
Status | NEW |
Importance | P normal |
Reported by | Mattia Basaglia (mattia.basaglia@gmail.com) |
Reported on | 2015-04-30 15:10:56 -0700 |
Last modified on | 2018-01-19 07:29:46 -0800 |
Version | 3.6 |
Hardware | PC Linux |
CC | bruno.cardoso@gmail.com, dgregor@apple.com, ditaliano@apple.com, jaak+llvm-bugs@ristioja.ee, keziahw@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, twoh@fb.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
The problem seems to be more general. I'm seeing the same error generated
incorrectly in a similar situation (tested with clang3.7).
This fails to compile:
#include <memory>
class Fail {
Fail& operator=(Fail&&) noexcept(true) = default;
std::unique_ptr<int> somePointer;
};
It works when noexcept is specified without (true). I'm not sure why the
template substitution for the unique_ptr has any constraints on the noexcept
specifications of the class that *owns* the unique_ptr, but syntactic
constraints are especially surprising.
The problem appears to still be happening on ToT:
-- t.cpp
template <class> struct something_template { static const bool value = true; };
struct A {
A() noexcept(something_template<int>::value) = default;
};
$ clang -std=c++11 t.cpp -c
t.cpp:3:3: error: exception specification is not available until end of class
definition
A() noexcept(something_template<int>::value) = default;
^
t.cpp:3:16: note: in instantiation of template class 'something_template<int>'
requested here
A() noexcept(something_template<int>::value) = default;
^
1 error generated.