http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57555
--- Comment #1 from Ari Sundholm ---
It seems that actually just making the variable const suffices:
uint8_t foo() {
static const uint8_t foo = 0xff;
uint8_t ret = ~foo;
return ret;
}
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: megari at mbnet dot fi
The following code produces a warning when it probably should not:
$ cat constexprbug.cpp
#include
uint8_t foo() {
static constexpr uint8_t foo = 0xff
--- Comment #1 from megari at mbnet dot fi 2008-04-10 12:09 ---
Created an attachment (id=15464)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15464&action=view)
Preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35899
e if appropriate.
See for instructions.
[EMAIL PROTECTED]:~/gcc-bug$
--
Summary: ICE on filesystem code
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: megari at mbnet dot fi
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35899