public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11487] New: g++ accepts non-type as type in declaration
@ 2003-07-10 10:39 hans dot ekkehard dot plesser at nlh dot no
  2003-07-10 14:26 ` [Bug c++/11487] " bangerth at dealii dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hans dot ekkehard dot plesser at nlh dot no @ 2003-07-10 10:39 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: g++ accepts non-type as type in declaration
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hans dot ekkehard dot plesser at nlh dot no
                CC: gcc-bugs at gcc dot gnu dot org

g++ (tested 2.95.3, 3.1, 3.2, 3.3) compiles the following code without warning:

---------------------
class foo {
public:
  foo() {};
};

foo a;           // legal
foo::foo b;      // illegal
foo::foo::foo c; // illegal
---------------------

IMHO, g++ should reject the definitions of both b and c, since neither foo::foo
nor foo::foo::foo are types.


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

* [Bug c++/11487] g++ accepts non-type as type in declaration
  2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
@ 2003-07-10 14:26 ` bangerth at dealii dot org
  2003-07-10 15:20 ` nathan at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2003-07-10 14:26 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at codesourcery dot
                   |                            |com


------- Additional Comments From bangerth at dealii dot org  2003-07-10 14:26 -------
Within the scope of foo, "foo" denotes the type itself, so the code may or
may not be legal. icc rejects it, for one. Nathan, what do you think?

This is most likely related to one PR we have where the out-of-line
constructor of a class is defined as
  X::X::X::X () {...}
and this is accepted. I can't find that report right now, though.

W.


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

* [Bug c++/11487] g++ accepts non-type as type in declaration
  2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
  2003-07-10 14:26 ` [Bug c++/11487] " bangerth at dealii dot org
@ 2003-07-10 15:20 ` nathan at gcc dot gnu dot org
  2004-08-17 17:11 ` reichelt at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: nathan at gcc dot gnu dot org @ 2003-07-10 15:20 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


nathan at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From nathan at gcc dot gnu dot org  2003-07-10 15:20 -------
not a bug.
[3.4/3 says 'because the name of a class is inserted in its class scope, the
name of the class is also considered a member of the class for the purposes of
name hiding and lookup.


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

* [Bug c++/11487] g++ accepts non-type as type in declaration
  2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
  2003-07-10 14:26 ` [Bug c++/11487] " bangerth at dealii dot org
  2003-07-10 15:20 ` nathan at gcc dot gnu dot org
@ 2004-08-17 17:11 ` reichelt at gcc dot gnu dot org
  2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
  2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-08-17 17:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-08-17 17:11 -------
*** Bug 15865 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it


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


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

* [Bug c++/11487] g++ accepts non-type as type in declaration
  2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
                   ` (2 preceding siblings ...)
  2004-08-17 17:11 ` reichelt at gcc dot gnu dot org
@ 2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
  2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-27  1:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-27 01:54 -------
bug 11764.

*** This bug has been marked as a duplicate of 11764 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug c++/11487] g++ accepts non-type as type in declaration
  2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
                   ` (3 preceding siblings ...)
  2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
@ 2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-27  1:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-27 01:54 -------
Reopening to mark as a dup of ...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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


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

end of thread, other threads:[~2004-08-27  1:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 10:39 [Bug c++/11487] New: g++ accepts non-type as type in declaration hans dot ekkehard dot plesser at nlh dot no
2003-07-10 14:26 ` [Bug c++/11487] " bangerth at dealii dot org
2003-07-10 15:20 ` nathan at gcc dot gnu dot org
2004-08-17 17:11 ` reichelt at gcc dot gnu dot org
2004-08-27  1:54 ` pinskia at gcc dot gnu dot org
2004-08-27  1:54 ` pinskia 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).