First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 30734
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: ulrich lauther <ulrich.lauther@siemens.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 30734 depends on: Show dependency tree
Show dependency graph
Bug 30734 blocks: 32106

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2007-02-08 10:46 Opened: 2007-02-08 09:59
1  namespace Foo {
   2  };
   3  
   4  class Foo {
   5  };
   6  
   7  int main() {
   8    class Foo1 : public Foo {
   9    };
  10    Foo1 my_Foo1; 
  11    Foo my_foo;
  12    return 0;
  13  }
  14  
  15  
Foo.C: In function 'int main()':
Foo.C:11: error: expected primary-expression before 'my_foo'
Foo.C:11: error: expected `;' before 'my_foo'

on line 8 and 10, "Foo" is understod asa class name, on line 11 as a namespace
Without line 11, no error message at all

------- Comment #1 From gdr@cs.tamu.edu 2007-02-08 10:16 -------
Subject: Re:   New: name conflict between class and namespace name is not
recognized

"ulrich dot lauther at siemens dot com" <gcc-bugzilla@gcc.gnu.org> writes:

| 1  namespace Foo {
|    2  };
|    3  
|    4  class Foo {
|    5  };
|    6  
|    7  int main() {
|    8    class Foo1 : public Foo {
|    9    };
|   10    Foo1 my_Foo1; 
|   11    Foo my_foo;
|   12    return 0;
|   13  }
|   14  
|   15  
| Foo.C: In function 'int main()':
| Foo.C:11: error: expected primary-expression before 'my_foo'
| Foo.C:11: error: expected `;' before 'my_foo'
| 
| on line 8 and 10, "Foo" is understod asa class name, on line 11 as a
namespace
| Without line 11, no error message at all

Line 4 is invalid; the front-end should have issued a diagnostic there.

-- Gaby

------- Comment #2 From David Fang 2007-04-05 06:11 -------
PR 2708 dup?

------- Comment #3 From Ollie Wild 2007-05-23 01:16 -------
Resolved by r124960 (cf.
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01182.html).

------- Comment #4 From Ollie Wild 2007-05-23 01:19 -------
*** Bug 2708 has been marked as a duplicate of this bug. ***

------- Comment #5 From Volker Reichelt 2007-12-26 19:40 -------
*** Bug 33287 has been marked as a duplicate of this bug. ***

------- Comment #6 From Paolo Carlini 2008-07-31 08:39 -------
*** Bug 36709 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available      Search page      Enter new bug