Open Quuxplusone opened 10 years ago
Bugzilla Link | PR21011 |
Status | NEW |
Importance | P normal |
Reported by | Mitsuru Kariya (kariya_mitsuru@hotmail.com) |
Reported on | 2014-09-20 07:14:01 -0700 |
Last modified on | 2014-09-25 20:04:56 -0700 |
Version | trunk |
Hardware | All All |
CC | dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
This issue is unrelated to lambdas; here's a reduced testcase:
struct S { typedef void (*p)(); operator p(); };
void (*p)() noexcept = S();
The question is, is this ill-formed? It's not possible for a conversion-type-id
to have an exception-specification, so checking the exception-specification for
this initialization seems unhelpful. In practice, EDG, GCC, and Clang accept
this, but MSVC rejects.
More generally, does "the target entity shall allow at least the exceptions
allowed by the source value in the assignment or initialization." apply when
there is no source value that could have an exception-specification?
I've mailed CWG for clarification.