public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/20905] New: confuses unrelated type name with instance name
@ 2005-04-08 16:54 boris at kolpackov dot net
  2005-04-08 16:58 ` [Bug c++/20905] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: boris at kolpackov dot net @ 2005-04-08 16:54 UTC (permalink / raw)
  To: gcc-bugs

$ cat >text.cxx
struct name {};

int 
f ();

void 
g ()
{
  if (int name = f ())
  {
  }
}

$ g++-3.4 -c text.cxx
test.cxx: In function `void g()':
test.cxx:9: error: expected primary-expression before "int"
test.cxx:9: error: expected `)' before "int"

-- 
           Summary: confuses unrelated type name with instance name
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: boris at kolpackov dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

* [Bug c++/20905] [3.4/4.0/4.1 Regression] confuses unrelated type name with instance name
  2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
@ 2005-04-08 16:58 ` pinskia at gcc dot gnu dot org
  2005-04-08 21:14 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-08 16:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-08 16:58 -------
Confirmed, most reduced testcase:
struct name {};
void g ()
{
  if (int name = 1)
  ;
}

: Search converges between 2002-12-14-trunk (#159) and 2002-12-29-trunk (#160).
Looks like it was introduced by the new C++ parser.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-04-08 16:58:00
               date|                            |
            Summary|confuses unrelated type name|[3.4/4.0/4.1 Regression]
                   |with instance name          |confuses unrelated type name
                   |                            |with instance name
   Target Milestone|---                         |3.4.4


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


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

* [Bug c++/20905] [3.4/4.0/4.1 Regression] confuses unrelated type name with instance name
  2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
  2005-04-08 16:58 ` [Bug c++/20905] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-04-08 21:14 ` cvs-commit at gcc dot gnu dot org
  2005-04-08 21:23 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-08 21:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-08 21:14 -------
Subject: Bug 20905

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-04-08 21:13:57

Modified files:
	gcc/cp         : ChangeLog parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: cond2.C 

Log message:
	PR c++/20905
	* parser.c (cp_parser_type_specifier_seq): Add is_condition
	parameter.
	(cp_parser_new_type_id): Pass it.
	(cp_parser_condition): Likewise.
	(cp_parser_conversion_type_id): Likewise.
	(cp_parser_type_id): Likewise.
	(cp_parser_type_specifier_seq): In a condition, do not allow
	invalid type-specifier combinations.
	(cp_parser_exception_declaration): Adjust call to
	cp_parser_type_specifier_seq.
	
	PR c++/20905
	* g++.dg/parse/cond2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4695&r2=1.4696
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.326&r2=1.327
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5305&r2=1.5306
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/cond2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/20905] [3.4/4.0/4.1 Regression] confuses unrelated type name with instance name
  2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
  2005-04-08 16:58 ` [Bug c++/20905] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-04-08 21:14 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-08 21:23 ` cvs-commit at gcc dot gnu dot org
  2005-04-08 21:41 ` [Bug c++/20905] [3.4 " mmitchel at gcc dot gnu dot org
  2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-08 21:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-04-08 21:23 -------
Subject: Bug 20905

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	mmitchel@gcc.gnu.org	2005-04-08 21:23:26

Modified files:
	gcc/cp         : ChangeLog parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: cond2.C 

Log message:
	PR c++/20905
	* parser.c (cp_parser_type_specifier_seq): Add is_condition
	parameter.
	(cp_parser_new_type_id): Pass it.
	(cp_parser_condition): Likewise.
	(cp_parser_conversion_type_id): Likewise.
	(cp_parser_type_id): Likewise.
	(cp_parser_type_specifier_seq): In a condition, do not allow
	invalid type-specifier combinations.
	(cp_parser_exception_declaration): Adjust call to
	cp_parser_type_specifier_seq.
	
	PR c++/20905
	* g++.dg/parse/cond2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.30&r2=1.4648.2.31
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.319.2.5&r2=1.319.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.118&r2=1.5084.2.119
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/cond2.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/20905] [3.4 Regression] confuses unrelated type name with instance name
  2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
                   ` (2 preceding siblings ...)
  2005-04-08 21:23 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-08 21:41 ` mmitchel at gcc dot gnu dot org
  2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-08 21:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2005-04-08 21:41 -------
Fixed in 4.0, 4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.4/4.0/4.1 Regression]    |[3.4 Regression] confuses
                   |confuses unrelated type name|unrelated type name with
                   |with instance name          |instance name


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


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

* [Bug c++/20905] [3.4 Regression] confuses unrelated type name with instance name
  2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
                   ` (3 preceding siblings ...)
  2005-04-08 21:41 ` [Bug c++/20905] [3.4 " mmitchel at gcc dot gnu dot org
@ 2005-05-19 17:35 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-05-19 17:35 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.4                       |3.4.5


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


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

end of thread, other threads:[~2005-05-19 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 16:54 [Bug c++/20905] New: confuses unrelated type name with instance name boris at kolpackov dot net
2005-04-08 16:58 ` [Bug c++/20905] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-04-08 21:14 ` cvs-commit at gcc dot gnu dot org
2005-04-08 21:23 ` cvs-commit at gcc dot gnu dot org
2005-04-08 21:41 ` [Bug c++/20905] [3.4 " mmitchel at gcc dot gnu dot org
2005-05-19 17:35 ` mmitchel at gcc dot gnu dot 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).