This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

Re: Some shadow fixes.


On Thu, 18 May 2000, Nathan Myers wrote:
>  
> I agree this is a compiler bug.  However, I think the sequence
> 
>   using std::abs;
>   using std::abs;
> 
> is not legal C++; hence my suggested #ifdefs.  

  At namespace scope I think it should be okay:  7.3.3/8

"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]"

and in 7.3.3/9

"9 The entity declared by a using-declaration shall be known in the context
using it according to its definition at the point of the using-declaration.
Definitions added to the namespace after the using-declaration are not
considered when a use of the name is made. [Example:

namespace A {
	void f(int);
}
using A::f; // f is a synonym for A::f;
	// that is, for A::f(int).

namespace A {
	void f(char);
}

void foo()
{
	f( a ); 	//calls f(int),
} 		//even though f(char) exists.
"
thus without the another using declaration, it wont work.
-- 
Steven King
sxking@uswest.net

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