https://bugs.llvm.org/show_bug.cgi?id=38227
Bug ID: 38227
Summary: constexpr function call is not noexcept
Product: clang
Version: 6.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
Assignee: unassignedclangb...@nondot.org
Reporter: andrey.vih...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Compiling the following code:
constexpr int f()
{
return 0;
}
static_assert(noexcept(f()), "f() should be noexcept");
with "clang++ -std=c++11 -c x.cpp" gives:
x.cpp:6:1: error: static_assert failed due to requirement 'noexcept(f())' "f()
should be noexcept"
static_assert(noexcept(f()), "f() should be noexcept");
^ ~~~~~~~~~~~~~
1 error generated.
According to https://en.cppreference.com/w/cpp/language/noexcept, it would
appear the assert should succeed, because "f()" is a constant expression. GCC
8.1 accepts the code.
clang --version:
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs