public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Using declarations
@ 1998-03-15 15:15 Martin von Loewis
  1998-03-16 20:25 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Martin von Loewis @ 1998-03-15 15:15 UTC (permalink / raw)
  To: egcs

I'm still not certain about the exact semantics of using declarations.
It seems to me that

namespace A{
  void f();
}

using A::f;

namespace A{
  void f(int);
}

using A::f;

void g(){
  f(4);
}

should be illegal. The redeclaration of 'using A::f;' is certainly
correct, however, the selected set of declarations should be the one
found at the first declaration.

If A::f(int) is visible inside ::g, please let me know why.

TIA,
Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using declarations
  1998-03-15 15:15 Using declarations Martin von Loewis
@ 1998-03-16 20:25 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 1998-03-16 20:25 UTC (permalink / raw)
  To: Martin von Loewis; +Cc: egcs

Martin von Loewis writes:

> I'm still not certain about the exact semantics of using declarations.

> The redeclaration of 'using A::f;' is certainly
> correct, however, the selected set of declarations should be the one
> found at the first declaration.

In my interpretation, a using declaration brings the current
definition of the specified name into the current namespace,
therefore, the redeclaration would bring the declarations of both
A::f(char) and A::f(int) into the global namespace.

But you're right, this is not explicitly stated in (my non-final copy
of) the Standard.  Time for one more question in comp.std.c++

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-03-16 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-03-15 15:15 Using declarations Martin von Loewis
1998-03-16 20:25 ` Alexandre Oliva

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