[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-27
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #7 from Andrew Pinski  ---
Confirmed.

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Andrew Pinski  changed:

   What|Removed |Added

 CC||andreim77 at yahoo dot com

--- Comment #6 from Andrew Pinski  ---
*** Bug 67663 has been marked as a duplicate of this bug. ***

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2016-06-10 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Manuel López-Ibáñez  changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #5 from Manuel López-Ibáñez  ---
(In reply to Piotr Pilarczyk from comment #4)
> Still present in 6.1, what's the current status of this bug (for some reason
> it's still marked as unconfirmed)? Will it ever get fixed or is it simply
> ignored?

Unfortunately, there is a limited number of devs and a lot of bugs to fix.
Re-reporting bugs helps no-one, since now we have to waste time closing the
duplicates, so less time to fix bugs.

UNCONFIRMED just means that no dev had the time or interest to look up in the
C++ standard whether this is really a bug.

If it is important enough for you, see:
https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2016-06-10 Thread ppilar11 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

--- Comment #4 from Piotr Pilarczyk  ---
Still present in 6.1, what's the current status of this bug (for some reason
it's still marked as unconfirmed)? Will it ever get fixed or is it simply
ignored?

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2016-01-14 Thread ppilar11 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

--- Comment #3 from Piotr Pilarczyk  ---
Still not fixed in 5.3.0, tested here:

https://gcc.godbolt.org/

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2015-11-25 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

--- Comment #2 from Paolo Carlini  ---
*** Bug 60025 has been marked as a duplicate of this bug. ***

[Bug c++/68188] Ambiguous code gets compiled successfully when class and its namespace have the same name

2015-11-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68188

Richard Biener  changed:

   What|Removed |Added

   Keywords||accepts-invalid,
   ||rejects-valid

--- Comment #1 from Richard Biener  ---
So the actual bug is that the following is rejected:

namespace Foo
{
  class Foo
{
public:
  static int x;
};

  int Foo::x;
}

int main()
{
  using namespace Foo;
  Foo::x;
  return 0;
}

which means that GCC does not consider the used namespace Foo when seeing
the qualified name 'Foo::x' (it finds Foo::Foo:x just fine).

When changing the above to

namespace Foo
{
  namespace Foo
{
  int x;
}
}
int main()
{
  using namespace Foo;
  Foo::x;
  return 0;
}

then we get

t.C: In function ‘int main()’:
t.C:11:3: error: reference to ‘Foo’ is ambiguous
   Foo::x;
   ^
t.C:2:1: note: candidates are: namespace Foo { }
 {
 ^
t.C:4:5: note: namespace Foo::Foo { }
 {
 ^

which means that the actual ambiguity is on 'Foo' (also with your own
testcase)?