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
* [Bug c++/47956] [C++0x] gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
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 ` redi at gcc dot gnu.org
2011-05-26 18:35 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2011-03-02 17:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47956
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.03.02 17:18:22
Summary|gcc accepts static data |[C++0x] gcc accepts static
|member declaration with |data member declaration
|initializer for non-const |with initializer for
|literal type if |non-const literal type if
|type-specifier is auto |type-specifier is auto
Ever Confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-02 17:18:22 UTC ---
confirmed, not a regression
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/47956] [C++0x] gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
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
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 18:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47956
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/47956] [C++0x] gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
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
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-27 4:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47956
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-27 04:01:51 UTC ---
Author: jason
Date: Fri May 27 04:01:46 2011
New Revision: 174317
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174317
Log:
PR c++/47956
* decl.c (check_static_variable_definition): Now static.
(cp_finish_decl): Call it here.
(grokdeclarator): Not here.
* pt.c (instantiate_class_template_1): Or here.
* cp-tree.h: Don't declare it.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/auto7.C
trunk/gcc/testsuite/g++.dg/template/crash50.C
trunk/gcc/testsuite/g++.dg/template/static9.C
trunk/gcc/testsuite/g++.old-deja/g++.ext/memconst.C
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/47956] [C++0x] gcc accepts static data member declaration with initializer for non-const literal type if type-specifier is auto
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
` (2 preceding siblings ...)
2011-05-27 4:05 ` jason at gcc dot gnu.org
@ 2011-05-27 4:40 ` jason at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-27 4:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47956
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.7.0
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-27 04:38:32 UTC ---
Fixed for 4.7.0.
^ 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).