public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/62143] New: unlimited number of class name qualifiers allowed
@ 2014-08-14 18:28 haynberg at sig dot com
  2014-08-15  0:38 ` [Bug c++/62143] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: haynberg at sig dot com @ 2014-08-14 18:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62143

            Bug ID: 62143
           Summary: unlimited number of class name qualifiers allowed
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haynberg at sig dot com

I'm not sure if this is a bug or allowed by the standard.  Either way, it's
strange this is allowed.

$ cat t.cpp
#include <iostream>
using namespace std;

struct X {
   void foo();
};

// an unlimited number of "X::"s are allowed !!
void X::X::X::X::X::foo()
{
   cout << "ctor" << endl;
}

// if you uncomment this, you'll get a redefinition error
// void X::foo()
// {
//    cout << "ctor" << endl;
// }

int main()
{
   X x;
   x.foo();
}

$ g++ t.cpp 
$ a.out
ctor
$ g++ -v 
...
gcc version 4.8.2 (GCC)
...
$ uname -isr
Linux 3.0.38-0.5-default x86_64


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

* [Bug c++/62143] unlimited number of class name qualifiers allowed
  2014-08-14 18:28 [Bug c++/62143] New: unlimited number of class name qualifiers allowed haynberg at sig dot com
@ 2014-08-15  0:38 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2014-08-15  0:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62143

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to haynberg from comment #0)
> I'm not sure if this is a bug or allowed by the standard.  Either way, it's
> strange this is allowed.

It's the behaviour required by the standard.


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

end of thread, other threads:[~2014-08-15  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14 18:28 [Bug c++/62143] New: unlimited number of class name qualifiers allowed haynberg at sig dot com
2014-08-15  0:38 ` [Bug c++/62143] " redi 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).