Topic: Error in FDIS: Double using declarations not allowed outside namespaces


Author: Dan Harkless <c++@unitech.com>
Date: 1998/02/26
Raw View
To: C++ core language mailing list
Message c++std-core-7709

My company is adding namespaces to the Hitachi C++ compiler, and there's one
FDIS passage that appears incorrect to us.  7.3.3 says:

8   A using-declaration is a declaration and can therefore be used repeatedly
    where (and only where) multiple declarations are allowed. [Example:

 namespace A {
  int i;
 }

 namespace A1 {
  using A::i;
  using A::i; // OK: double declaration
 }

 void f()
 {
  using A::i;
  using A::i; // error: double declaration
 }

 class B {
 public:
  int i;
 };

 class X : public B {
  using B::i;
  using B::i; // error: double member declaration
 };

    --end example]

The text in 8 appears to be a truism -- as far as we know, multiple
declarations are allowed *everywhere*.

Given this, the example appears to be incorrect.  We can find no text in the
standard showing that the second and third using declarations should be
errors.  If the using declarations were replaced by 'extern' declarations,
they would be legal, no?

The one thing that detracts from our belief that this example is wrong is
the fact that it made it into the FDIS.  I found no mention of this issue on
the c++-std mailing lists during the time we've been archiving them, so
apparently everyone agreed with this text or didn't notice it.  I found one
small thread from mid-'95 on comp.std.c++ where one person said he felt the
example was wrong and another agreed, but that was the last mention of it.

--
Dan Harkless
c++@unitech.com
Unitech Research, Inc.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]