http://llvm.org/bugs/show_bug.cgi?id=17694
Bug ID: 17694
Summary: Rejects-valid: constexpr and explicit default ctor
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Debian clang version 3.4-1~exp1 (trunk) (based on LLVM 3.4)
Target: x86_64-pc-linux-gnu
Thread model: posix
The following code when compiled with
/usr/bin/clang++ -std=c++11 -c -o cpp11-constexpr.o cpp11-constexpr.cpp
is rejected:
###########################
class A
{
public:
constexpr A() = default;
};
int main(int argc, char** argv)
{
constexpr A a;
}
############################
Changing the defaulted ctor to a user provided one, i. e. "constexpr A() {}",
lets clang accept the code.
My interpretation of ยง3.9 10 is that A is in both cases a literal type and both
possibilities should be accepted.
In case I'm wrong, I'd be glad for an answer as current g++ versions accept the
above code.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs