[LLVMbugs] [Bug 19897] New: clang doesn't diagnose missing constexpr on static constexpr definition

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 30 05:24:21 PDT 2014


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

            Bug ID: 19897
           Summary: clang doesn't diagnose missing constexpr on static
                    constexpr definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang accepts this code without diagnostic:


class A {
public:
  static constexpr const int max_digits10 = 0;
};
const int A::max_digits10;



gcc on the other hand complains
  error: redeclaration ‘A::max_digits10’ differs in ‘constexpr’
  error: from previous declaration ‘A::max_digits10’


(Due to clang not diagnosing this, a missing constexpr in libc++ went unnoticed
for a long time, see r209888)

-- 
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/20140530/66fbd312/attachment.html>


More information about the llvm-bugs mailing list