public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47956] New: gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
@ 2011-03-02 13:53 boostcpp at gmail dot com
  2011-03-02 17:18 ` [Bug c++/47956] [C++0x] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: boostcpp at gmail dot com @ 2011-03-02 13:53 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-27  4:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 13:53 [Bug c++/47956] New: gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto boostcpp at gmail dot com
2011-03-02 17:18 ` [Bug c++/47956] [C++0x] " redi at gcc dot gnu.org
2011-05-26 18:35 ` jason at gcc dot gnu.org
2011-05-27  4:05 ` jason at gcc dot gnu.org
2011-05-27  4:40 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).