This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9022: using declaration accepted as using directive


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]