https://bugs.llvm.org/show_bug.cgi?id=38013
Bug ID: 38013
Summary: constexpr const char* comparison error
Product: clang
Version: 6.0
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
The following snippet seems to produce contradictory results when comparing
const char* pointers in a constexpr expression:
constexpr auto name1() {
return "test1";
}
constexpr auto name2() {
return "test2";
}
int main() {
constexpr auto b1 = (name1() == name1()); // compiles cleanly
constexpr auto b2 = (name1() == name2()); // doesn't compile
}
Apparently (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86369), neither should
compile. Live code here: https://godbolt.org/g/8W4VrS
--
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