https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79592
Bug ID: 79592
Summary: incomplete diagnostic "is not usable as a constexpr
function because:"
Product: gcc
Version: 6.3.1
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
struct pthread_mutex {
void *m_ptr;
};
struct M {
pthread_mutex m = { ((void *) 1LL) };
};
constexpr M m;
pt.cc:9:13: error: ‘constexpr M::M()’ called in a constant expression
constexpr M m;
^
pt.cc:5:8: note: ‘constexpr M::M()’ is not usable as a constexpr function
because:
struct M {
^
It just says "because:" without saying what the problem is (the cast is not
allowed in a constant expression).
If the expression is (void*)1 rather than (void*)1LL then it is incorrectly
accepted.