public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏
@ 2011-01-05 18:56 zeratul976 at hotmail dot com
  2011-05-25 15:48 ` [Bug c++/47184] " jason at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zeratul976 at hotmail dot com @ 2011-01-05 18:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

           Summary: gcc interprets C++0x initialization construct as
                    function declaration‏‏
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zeratul976@hotmail.com


For the following code:

struct S
{
    int a;
    float b;
};
struct T
{
    T(S s) {}
};
int main()
{
    T t(S{1, 0.1}); // ERROR HERE
}

gcc 4.6 trunk gives the following errors (with the --std=c++0x option):

decl.cpp: In function 'int main()':
decl.cpp:14:10: error: expected ')' before '{' token
decl.cpp:14:10: error: a function-definition is not allowed here before '{'
token
decl.cpp:14:18: error: expected primary-expression before ')' token
decl.cpp:14:18: error: expected ';' before ')' token

It seems gcc is interpreting the statement as a function declaration.

I think this is valid C++0x.


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

* [Bug c++/47184] gcc interprets C++0x initialization construct as function declaration‏‏
  2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
@ 2011-05-25 15:48 ` jason at gcc dot gnu.org
  2011-05-25 19:52 ` [Bug c++/47184] [C++0x] initialization construct interpreted " jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25 15:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.05.25 15:42:06
                 CC|                            |jason at gcc dot gnu.org
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1


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

* [Bug c++/47184] [C++0x] initialization construct interpreted as function declaration‏‏
  2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
  2011-05-25 15:48 ` [Bug c++/47184] " jason at gcc dot gnu.org
@ 2011-05-25 19:52 ` jason at gcc dot gnu.org
  2011-05-25 20:30 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25 19:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 19:50:52 UTC ---
Author: jason
Date: Wed May 25 19:50:49 2011
New Revision: 174225

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174225
Log:
    PR c++/47184
    * parser.c (cp_parser_parameter_declaration): Recognize
    list-initialization.
    (cp_parser_direct_declarator): Check for the closing
    paren before parsing definitely.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist51.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/47184] [C++0x] initialization construct interpreted as function declaration‏‏
  2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
  2011-05-25 15:48 ` [Bug c++/47184] " jason at gcc dot gnu.org
  2011-05-25 19:52 ` [Bug c++/47184] [C++0x] initialization construct interpreted " jason at gcc dot gnu.org
@ 2011-05-25 20:30 ` jason at gcc dot gnu.org
  2011-05-26 13:47 ` jason at gcc dot gnu.org
  2011-05-26 14:03 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-25 20:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-25 20:29:42 UTC ---
Author: jason
Date: Wed May 25 20:29:39 2011
New Revision: 174232

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=174232
Log:
    PR c++/47184
    * parser.c (cp_parser_parameter_declaration): Recognize
    list-initialization.
    (cp_parser_direct_declarator): Check for the closing
    paren before parsing definitely.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/initlist51.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/parser.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/47184] [C++0x] initialization construct interpreted as function declaration‏‏
  2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
                   ` (2 preceding siblings ...)
  2011-05-25 20:30 ` jason at gcc dot gnu.org
@ 2011-05-26 13:47 ` jason at gcc dot gnu.org
  2011-05-26 14:03 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 13:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.1

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-26 13:44:35 UTC ---
Fixed for 4.6.1.


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

* [Bug c++/47184] [C++0x] initialization construct interpreted as function declaration‏‏
  2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
                   ` (3 preceding siblings ...)
  2011-05-26 13:47 ` jason at gcc dot gnu.org
@ 2011-05-26 14:03 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-26 14:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47184

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-26 13:48:25 UTC ---
...and actually change status.


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

end of thread, other threads:[~2011-05-26 13:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-05 18:56 [Bug c++/47184] New: gcc interprets C++0x initialization construct as function declaration‏‏ zeratul976 at hotmail dot com
2011-05-25 15:48 ` [Bug c++/47184] " jason at gcc dot gnu.org
2011-05-25 19:52 ` [Bug c++/47184] [C++0x] initialization construct interpreted " jason at gcc dot gnu.org
2011-05-25 20:30 ` jason at gcc dot gnu.org
2011-05-26 13:47 ` jason at gcc dot gnu.org
2011-05-26 14:03 ` 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).