https://llvm.org/bugs/show_bug.cgi?id=28390
Bug ID: 28390
Summary: Clang incorrectly emits definition for undefined
constexpr static data member.
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Reproducer:
//---------------------
struct Foo {
static const bool undefined = true; // still is correctly undefined
static constexpr bool incorrectly_defined = true; // clang emits a definition
};
void test(const bool&) {}
int main() {
test(Foo::incorrectly_defined); // shouldn't link
// test(Foo::undefined); // doesn't link
}
//------------------------
Clang has started emitting a definition for "incorrectly_defined", this means
the above test case compiles and links successfully when it could fail to
compile. It also causes ODR violations when "incorrectly_defined" is actually
defined in another TU.
Note that Clang did not emit a definition for this code in 3.8, and I think it
started within the last two weeks, since that's when I started noticing errors.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs