This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66478] New: [constexpr] accepts-invalid with read of non-constant variable as discarded value
- 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:41:42 +0000
- Subject: [Bug c++/66478] New: [constexpr] accepts-invalid with read of non-constant variable as discarded value
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66478
Bug ID: 66478
Summary: [constexpr] accepts-invalid with read of non-constant
variable as discarded value
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 ill-formed code:
void f(int n) { static_assert((+n, true), ""); }
This is invalid because it reads the variable 'n', whose value is not known
within the constant expression.