[LLVMbugs] [Bug 17694] New: Rejects-valid: constexpr and explicit default ctor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 25 09:53:37 PDT 2013


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: unassignedclangbugs at nondot.org
          Reporter: thomas.braun at virtuell-zuhause.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131025/e989372f/attachment.html>


More information about the llvm-bugs mailing list