public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9022: using declaration accepted as using directive
@ 2002-12-20 4:56 fonseca
0 siblings, 0 replies; 3+ messages in thread
From: fonseca @ 2002-12-20 4:56 UTC (permalink / raw)
To: gcc-gnats
>Number: 9022
>Category: c++
>Synopsis: using declaration accepted as using directive
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Dec 20 04:56:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: fonseca@mip.sdu.dk
>Release: confirmed with gcc-3.2 and gcc-2.95-3
>Organization:
>Environment:
confirmed under solaris-2.8, gnu/linux, and cygwin
>Description:
GCC currently accepts an invalid using declaration.
The first line marked with "// error" must not be accepted
because "org::gnu::gcc" is a namespace.
Warning: This information is based on my interpretation of http://anubis.dkuug.dk/jtc1/sc22/open/n2356
> >>
namespace org {
namespace gnu {
namespace gcc {
}
}
}
using org::gnu::gcc; // error - using declaration
using namespace org::gnu::gcc; // ok - using directive
class MyClass {
private:
// the using declaration below is rejected as it should be
// but for the wrong reason. the standard requires ANY
// using declaration to be accepted as a member
// declaration.
// using org::gnu::gcc; // error - using declaration
};
int main() {
return 0;
}
<<<
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/9022: using declaration accepted as using directive
@ 2002-12-20 19:13 bangerth
0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-12-20 19:13 UTC (permalink / raw)
To: fonseca, gcc-bugs, gcc-prs, nobody
Synopsis: using declaration accepted as using directive
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Dec 20 19:13:09 2002
State-Changed-Why:
Confirmed. Short testcase:
---------------
namespace gnu {
namespace gcc {
}
}
using gnu::gcc;
------------
This should be rejected, but is not.
Regarding your other problem: this is what gcc3.4
and icc7 say:
tmp/g> /home/bangerth/bin/gcc-3.4-CVS/bin/c++ -c x.cc
x.cc:6: error: using-declaration for non-member at class scope
tmp/g> icc -c x.cc
x.cc(6): error: a class-qualified name is required
using gnu::gcc;
^
I think they both say the same, but in different words,
so I'd say this is ok. However, this doesn't touch the
problem above.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9022
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/9022: using declaration accepted as using directive
@ 2003-05-18 10:42 lerdsuwa
0 siblings, 0 replies; 3+ messages in thread
From: lerdsuwa @ 2003-05-18 10:42 UTC (permalink / raw)
To: fonseca, gcc-bugs, gcc-prs, nobody
Synopsis: using declaration accepted as using directive
State-Changed-From-To: analyzed->closed
State-Changed-By: lerdsuwa
State-Changed-When: Sun May 18 10:42:12 2003
State-Changed-Why:
Fixed in the main trunk.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9022
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-05-18 10:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20 4:56 c++/9022: using declaration accepted as using directive fonseca
2002-12-20 19:13 bangerth
2003-05-18 10:42 lerdsuwa
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).