https://llvm.org/bugs/show_bug.cgi?id=24254
Bug ID: 24254
Summary: No diagnostic for mismatch between const and constexpr
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Given these mismatched declarations:
extern const char kAbc[];
constexpr char kAbc[] = "abc";
Clang (trunk as of today) compiles this code with no errors:
$ clang++ -c foo.cc -std=c++11
But GCC 4.8 gives the following error:
$ g++ -std=c++11 -c foo.cc
foo.cc:2:21: error: redeclaration 'kAbc' differs in 'constexpr'
constexpr char kAbc[] = "abc";
^
foo.cc:1:19: error: from previous declaration 'kAbc'
extern const char kAbc[];
^
--
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