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
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).