* [Bug c++/16468] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
@ 2004-07-11 14:51 ` lerdsuwa at gcc dot gnu dot org
2004-07-12 6:39 ` [Bug c++/16468] [DR460] " pinskia at gcc dot gnu dot org
` (13 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-07-11 14:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-07-11 14:51 -------
There is a defect report about this at:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#460
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
2004-07-11 14:51 ` [Bug c++/16468] " lerdsuwa at gcc dot gnu dot org
@ 2004-07-12 6:39 ` pinskia at gcc dot gnu dot org
2004-07-12 15:54 ` boris at kolpackov dot net
` (12 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-12 6:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-12 06:38 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2004-07-12 06:38:58
date| |
Summary|using-declaration of |[DR460] using-declaration of
|namespace name |namespace name
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
2004-07-11 14:51 ` [Bug c++/16468] " lerdsuwa at gcc dot gnu dot org
2004-07-12 6:39 ` [Bug c++/16468] [DR460] " pinskia at gcc dot gnu dot org
@ 2004-07-12 15:54 ` boris at kolpackov dot net
2004-07-12 18:52 ` bangerth at dealii dot org
` (11 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: boris at kolpackov dot net @ 2004-07-12 15:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From boris at kolpackov dot net 2004-07-12 15:54 -------
Can somebody please enlighten me about what's wrong with using-declaration
naming a namespace?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (2 preceding siblings ...)
2004-07-12 15:54 ` boris at kolpackov dot net
@ 2004-07-12 18:52 ` bangerth at dealii dot org
2004-07-12 21:25 ` Gabriel Dos Reis
2004-07-12 18:58 ` boris at kolpackov dot net
` (10 subsequent siblings)
14 siblings, 1 reply; 20+ messages in thread
From: bangerth at dealii dot org @ 2004-07-12 18:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-07-12 18:52 -------
Possibly nothing, though it seems (from the DR) as if the makers
of the standard intended the using declaration for names of classes,
functions, variables, etc. For namespaces why not use the using
directive
using namespace namespace-name;
which seems to be the more obvious choice anyway?
Given that the DR lists that this should be an error, it seems unlikely
that this 'bug' will be fixed in the direction which you seem to prefer.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-12 18:52 ` bangerth at dealii dot org
@ 2004-07-12 21:25 ` Gabriel Dos Reis
0 siblings, 0 replies; 20+ messages in thread
From: Gabriel Dos Reis @ 2004-07-12 21:25 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org 2004-07-12
> 18:52 -------
> Possibly nothing, though it seems (from the DR) as if the makers
> of the standard intended the using declaration for names of classes,
> functions, variables, etc. For namespaces why not use the using
> directive
> using namespace namespace-name;
> which seems to be the more obvious choice anyway?
because
(1) it is arbitrary restriction
(2) it has a *very* very different meaning. It modifies
name lookup -- the original poster did NOT intend to dump
everything in the current scope.
I'm amazed at seeing the proposed resolution. I suppose
I have to raise that at the next meeting.
-- Gaby
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (3 preceding siblings ...)
2004-07-12 18:52 ` bangerth at dealii dot org
@ 2004-07-12 18:58 ` boris at kolpackov dot net
2004-07-12 20:53 ` bangerth at dealii dot org
` (9 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: boris at kolpackov dot net @ 2004-07-12 18:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From boris at kolpackov dot net 2004-07-12 18:58 -------
> For namespaces why not use the using directive
Because it is not the same.
> Given that the DR lists that this should be an error
It does not. It is still in drafting state.
I guess I will have to ask at comp.std.c++
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (4 preceding siblings ...)
2004-07-12 18:58 ` boris at kolpackov dot net
@ 2004-07-12 20:53 ` bangerth at dealii dot org
2004-07-12 21:27 ` Gabriel Dos Reis
2004-07-12 21:25 ` boris at kolpackov dot net
` (8 subsequent siblings)
14 siblings, 1 reply; 20+ messages in thread
From: bangerth at dealii dot org @ 2004-07-12 20:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-07-12 20:53 -------
I'm not sure what you want. Of course the DR is only in drafting stage, but
an inclination has been expressed, and the gcc project would be ill-advised
to implement anything now that would oppose this inclination.
As for your question of why a using-declaration should not be allowed to
name namespace names: using declarations are used to inject declarations
into a scope, for example into a class scope:
class Base {
void f(int);
};
class Derived : public Base {
using Base::f;
void f(double);
};
Obviously, allowing a namespace name in a using-declaration inside a class
declaration does not make much sense. I think I'm just confused what effect
you try to achieve by allowing namespace names in using-declarations that
can't be achieved by other means as well?
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-12 20:53 ` bangerth at dealii dot org
@ 2004-07-12 21:27 ` Gabriel Dos Reis
0 siblings, 0 replies; 20+ messages in thread
From: Gabriel Dos Reis @ 2004-07-12 21:27 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
bangerth at dealii dot org:
> As for your question of why a using-declaration should not be allowed to
> name namespace names: using declarations are used to inject declarations
> into a scope, for example into a class scope:
Right.
> class Base {
> void f(int);
> };
> class Derived : public Base {
> using Base::f;
> void f(double);
> };
> Obviously, allowing a namespace name in a using-declaration inside a class
> declaration does not make much sense.
Why doesn't it make sense? A definition is a declaration, so
if the namespace has an original-definition, it makes all sense
to bring its name into current scope.
I think I'm just confused what
> effect
> you try to achieve by allowing namespace names in using-declarations that
> can't be achieved by other means as well?
I'm confused as to why people would like to ban using-declaration
for namespace-names.
-- Gaby
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (5 preceding siblings ...)
2004-07-12 20:53 ` bangerth at dealii dot org
@ 2004-07-12 21:25 ` boris at kolpackov dot net
2004-07-12 21:32 ` Gabriel Dos Reis
2004-07-12 21:25 ` gdr at acm dot org
` (7 subsequent siblings)
14 siblings, 1 reply; 20+ messages in thread
From: boris at kolpackov dot net @ 2004-07-12 21:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From boris at kolpackov dot net 2004-07-12 21:25 -------
> Obviously, allowing a namespace name in a using-declaration inside a class
> declaration does not make much sense.
This is a bogus argument! Only names from base are allowed in using-declaration
inside a class. Following your logic we should also ban somethin like
namespace n
{
class foo {};
};
using n::foo;
Just because you cannot write
class bar
{
using n::foo;
};
> I think I'm just confused what effect you try to achieve by allowing namespace
> names in using-declarations that can't be achieved by other means as well?
Sure it can be achived by other means. I just don't see a reason why should it
be achived by other means? Here is the whole story: I have some amount of code
which works fine with gcc 3.x.y. Now I try to compile it with gcc 3.4.x and it
gives me an error about using-declaring namespace. Ok, I am thinking to myself,
it is probably either illegal or bug in gcc. So I am searching throug the
standard for any restrictions on the type of name that can be used in
using-declaration. The standard say none. Ok, I am thinking to myself, there
doesn't seem to be any good reason why one shouldn't using-declare a namespace
so it must be a bug in gcc. I am posting a bug report which is closed due to a
defect report (which, btw, hasn't been even voted upon) that says "we believe it
should be an error". Don't take it personaly, but if there is a defect report
that says everybody should start jumping off the roof, would you?
I posted a question to std.c++. I will follow up if anything comes out.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (6 preceding siblings ...)
2004-07-12 21:25 ` boris at kolpackov dot net
@ 2004-07-12 21:25 ` gdr at acm dot org
2004-07-12 21:27 ` gdr at acm dot org
` (6 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: gdr at acm dot org @ 2004-07-12 21:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at acm dot org 2004-07-12 21:24 -------
Subject: Re: [DR460] using-declaration of namespace name
bangerth at dealii dot org
>
> ------- Additional Comments From bangerth at dealii dot org 2004-07-12
> 18:52 -------
> Possibly nothing, though it seems (from the DR) as if the makers
> of the standard intended the using declaration for names of classes,
> functions, variables, etc. For namespaces why not use the using
> directive
> using namespace namespace-name;
> which seems to be the more obvious choice anyway?
because
(1) it is arbitrary restriction
(2) it has a *very* very different meaning. It modifies
name lookup -- the original poster did NOT intend to dump
everything in the current scope.
I'm amazed at seeing the proposed resolution. I suppose
I have to raise that at the next meeting.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (7 preceding siblings ...)
2004-07-12 21:25 ` gdr at acm dot org
@ 2004-07-12 21:27 ` gdr at acm dot org
2004-07-12 21:32 ` gdr at acm dot org
` (5 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: gdr at acm dot org @ 2004-07-12 21:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at acm dot org 2004-07-12 21:27 -------
Subject: Re: [DR460] using-declaration of namespace name
bangerth at dealii dot org:
> As for your question of why a using-declaration should not be allowed to
> name namespace names: using declarations are used to inject declarations
> into a scope, for example into a class scope:
Right.
> class Base {
> void f(int);
> };
> class Derived : public Base {
> using Base::f;
> void f(double);
> };
> Obviously, allowing a namespace name in a using-declaration inside a class
> declaration does not make much sense.
Why doesn't it make sense? A definition is a declaration, so
if the namespace has an original-definition, it makes all sense
to bring its name into current scope.
I think I'm just confused what
> effect
> you try to achieve by allowing namespace names in using-declarations that
> can't be achieved by other means as well?
I'm confused as to why people would like to ban using-declaration
for namespace-names.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (8 preceding siblings ...)
2004-07-12 21:27 ` gdr at acm dot org
@ 2004-07-12 21:32 ` gdr at acm dot org
2004-07-12 21:38 ` boris at kolpackov dot net
` (4 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: gdr at acm dot org @ 2004-07-12 21:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at acm dot org 2004-07-12 21:32 -------
Subject: Re: [DR460] using-declaration of namespace name
boris at kolpackov dot net:
> Sure it can be achived by other means. I just don't see a reason why
> should it
> be achived by other means?
I'm of the opinion that it is a mistake to ban using-declarations
that bring namespace names into scope. I'll take it to Core.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (9 preceding siblings ...)
2004-07-12 21:32 ` gdr at acm dot org
@ 2004-07-12 21:38 ` boris at kolpackov dot net
2004-07-13 4:19 ` bangerth at dealii dot org
` (3 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: boris at kolpackov dot net @ 2004-07-12 21:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From boris at kolpackov dot net 2004-07-12 21:38 -------
> I'm of the opinion that it is a mistake to ban using-declarations
> that bring namespace names into scope. I'll take it to Core.
Thanks Gaby.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (10 preceding siblings ...)
2004-07-12 21:38 ` boris at kolpackov dot net
@ 2004-07-13 4:19 ` bangerth at dealii dot org
2004-07-13 4:25 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
14 siblings, 0 replies; 20+ messages in thread
From: bangerth at dealii dot org @ 2004-07-13 4:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-07-13 04:18 -------
In response to comment #8:
Boris, you will have realized that I was the one who actually _reopened_
the bug. I may have been misunderstood, my statement was rather meant
to say that I believe that nothing will happen with this PR until the
DR has been formally voted on. gcc does try to implement voted on DRs,
and sometimes DRs for which the outcome seems predictable. However,
I don't see anyone going to implement your suggestion as long as the
audit trail of the PR indicates that the committee might decide in the
opposite direction. If the committee changes its mind, then that's a
completely different matter.
As for my questions why one would want to ban this: I was merely giving
a few hints. I am not a member of the committee, so I have no idea what
they were thinking. My opinion is unimportant in that matter. If I have
stepped on someone's feet, I apologize. My intent was certainly not to
start a flame war.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (11 preceding siblings ...)
2004-07-13 4:19 ` bangerth at dealii dot org
@ 2004-07-13 4:25 ` pinskia at gcc dot gnu dot org
2005-05-01 3:16 ` pinskia at gcc dot gnu dot org
2005-08-31 21:14 ` redi at gcc dot gnu dot org
14 siblings, 0 replies; 20+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-13 4:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-13 04:25 -------
Note actually this bug never got closed at all. I read the DR report and confirmed it, I was thinking
about suspending it but decided against that because the DR was already in drafting which means they
were drafting the final conclusion to the DR.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (12 preceding siblings ...)
2004-07-13 4:25 ` pinskia at gcc dot gnu dot org
@ 2005-05-01 3:16 ` pinskia at gcc dot gnu dot org
2005-08-31 21:14 ` redi at gcc dot gnu dot org
14 siblings, 0 replies; 20+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-01 3:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-01 03:16 -------
Hmm, it looks like GCC is going to be correct and rejecting this. The DR is now in ready state (I forgot
what this means).
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-01-11 02:31:10 |2005-05-01 03:16:13
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread
* [Bug c++/16468] [DR460] using-declaration of namespace name
2004-07-10 21:04 [Bug c++/16468] New: using-declaration of namespace name boris at kolpackov dot net
` (13 preceding siblings ...)
2005-05-01 3:16 ` pinskia at gcc dot gnu dot org
@ 2005-08-31 21:14 ` redi at gcc dot gnu dot org
14 siblings, 0 replies; 20+ messages in thread
From: redi at gcc dot gnu dot org @ 2005-08-31 21:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From redi at gcc dot gnu dot org 2005-08-31 21:10 -------
The resolution of DR460 makes this code illegal and GCC's behaviour correct.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16468
^ permalink raw reply [flat|nested] 20+ messages in thread