This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66477] New: [constexpr] accepts-invalid with constexpr member call on non-constant reference
- From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Jun 2015 18:39:54 +0000
- Subject: [Bug c++/66477] New: [constexpr] accepts-invalid with constexpr member call on non-constant reference
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477
Bug ID: 66477
Summary: [constexpr] accepts-invalid with constexpr member call
on non-constant reference
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richard-gccbugzilla at metafoo dot co.uk
Target Milestone: ---
GCC accepts this invalid code:
struct a { constexpr int size() const { return 3; } };
void f(a &r) { static_assert(r.size() == 3, "error"); }
The static_assert condition is non-constant because it mentions the reference
'r' whose referent is not known within that constant expression.