public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67663] New: ambiguous namespace/class name not reported as error
@ 2015-09-21  8:18 andreim77 at yahoo dot com
  2015-09-21  8:33 ` [Bug c++/67663] " andreim77 at yahoo dot com
  2021-07-27 22:09 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: andreim77 at yahoo dot com @ 2015-09-21  8:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

            Bug ID: 67663
           Summary: ambiguous namespace/class name not reported as error
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andreim77 at yahoo dot com
  Target Milestone: ---

#include <iostream>

struct a {
    static const int i=0;
};

namespace x {
    namespace a {
        int i;
    }
}

using namespace x;

int main()
{
    a::i=1;
    std::cout << "i = " << a::i;
    return 0;
}

no error with GCC

clang report:
main.cpp:17:5: error: 'a' is not a class, namespace, or enumeration
    a::i=1;
    ^
main.cpp:17:5: error: reference to 'a' is ambiguous
    a::i=1;
    ^
main.cpp:3:8: note: candidate found by name lookup is 'a'
struct a {
       ^
main.cpp:8:15: note: candidate found by name lookup is 'x::a'
    namespace a {
              ^
main.cpp:18:28: error: 'a' is not a class, namespace, or enumeration
    std::cout << "i = " << a::i;
                           ^
main.cpp:18:28: error: reference to 'a' is ambiguous
    std::cout << "i = " << a::i;
                           ^
main.cpp:3:8: note: candidate found by name lookup is 'a'
struct a {
       ^
main.cpp:8:15: note: candidate found by name lookup is 'x::a'
    namespace a {
              ^
main.cpp:20:2: error: no newline at end of file [-Werror,-Wnewline-eof]
}
 ^
5 errors generated.


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

* [Bug c++/67663] ambiguous namespace/class name not reported as error
  2015-09-21  8:18 [Bug c++/67663] New: ambiguous namespace/class name not reported as error andreim77 at yahoo dot com
@ 2015-09-21  8:33 ` andreim77 at yahoo dot com
  2021-07-27 22:09 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: andreim77 at yahoo dot com @ 2015-09-21  8:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

--- Comment #1 from Andrei M. <andreim77 at yahoo dot com> ---
in line:

a::i=1;

i is resolved to x::a::i


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

* [Bug c++/67663] ambiguous namespace/class name not reported as error
  2015-09-21  8:18 [Bug c++/67663] New: ambiguous namespace/class name not reported as error andreim77 at yahoo dot com
  2015-09-21  8:33 ` [Bug c++/67663] " andreim77 at yahoo dot com
@ 2021-07-27 22:09 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-27 22:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67663

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 68188.

*** This bug has been marked as a duplicate of bug 68188 ***

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

end of thread, other threads:[~2021-07-27 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21  8:18 [Bug c++/67663] New: ambiguous namespace/class name not reported as error andreim77 at yahoo dot com
2015-09-21  8:33 ` [Bug c++/67663] " andreim77 at yahoo dot com
2021-07-27 22:09 ` pinskia at gcc dot gnu.org

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