This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47956] New: gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
- From: "boostcpp at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 2 Mar 2011 13:53:26 +0000
- Subject: [Bug c++/47956] New: gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47956
Summary: gcc accepts static data member declaration with
initializer for non-const literal type if
type-specifier is auto
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: boostcpp@gmail.com
gcc accepts static data member declaration with brace-or-equal-initializer for
non-const literal type, when the type-specifier is the plain auto specifier.
struct X
{
static auto member = 0 ;
} ;
The type of X::member is deduced to be int.
But static data member declaration is allowed to have
brace-or-equal-initializer if the type is const literal type.
So this code must be ill-formed.