[LLVMbugs] [Bug 13493] New: Explicitly defaulted constructors cannot be declared constexpr

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 31 13:44:05 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13493

             Bug #: 13493
           Summary: Explicitly defaulted constructors cannot be declared
                    constexpr
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: aaron at aaronballman.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


As per dcl.fct.def.default/3:

[ Example:
struct S {
  constexpr S() = default; // ill-formed: implicit S() is not constexpr
  S(int a = 0) = default; // ill-formed: default argument
  void operator=(const S&) = default; // ill-formed: non-matching return type
  ~S() throw(int) = default; // ill-formed: exception specification does not
match
private:
  int i;
  S(S&); // OK: private copy constructor
};
S::S(S&) = default; // OK: defines copy constructor

Clang happily accepts a constexpr on an explicitly defaulted constructor:

struct A {
  constexpr A() = default;  // Should emit diagnostic
};

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list