https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85032
Bug ID: 85032 Summary: Wrong non-constant condition for static assertion Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- We should accept this one struct A { constexpr operator bool () { return true; } int i; }; A a; template <class T> void f() { constexpr bool b = a; static_assert (a); } int main() { f<int>(); } instead, we reject it with constexpr-if17.C: In function ‘void f()’: constexpr-if17.C:12:18: error: non-constant condition for static assertion static_assert (a); ^ constexpr-if17.C:12:18: error: the value of ‘a’ is not usable in a constant expression constexpr-if17.C:7:3: note: ‘a’ was not declared ‘constexpr’ A a; ^