public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11540] New: ambiguous using reference is not error
@ 2010-04-26  7:30 jan dot kratochvil at redhat dot com
  2010-04-29 21:05 ` [Bug c++/11540] " swagiaal at redhat dot com
  2010-07-22 15:39 ` swagiaal at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jan dot kratochvil at redhat dot com @ 2010-04-26  7:30 UTC (permalink / raw)
  To: gdb-prs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

namespace A { int x = 1; }
namespace B { int x = 2; }
int main (void)
{
  using namespace A;
  using namespace B;
  return 0;
}
------------------------------------------------------------------------------
If I would use `return x;' the compiler would complain:
1.C:7: error: reference to ‘x’ is ambiguous
1.C:2: error: candidates are: int B::x
1.C:1: error:                 int A::x
------------------------------------------------------------------------------
But in GDB I get:
7	  return 0;
(gdb) p x
$1 = 1
and after I switch
  using namespace B;
  using namespace A;
I get:
(gdb) p x
$1 = 2
------------------------------------------------------------------------------
GDB thus does not have the behavior of compiler.  Expecting something like:
(gdb) p x
Reference to ‘x’ is ambiguous, candidates are `int B::x', `int A::x'.

-- 
           Summary: ambiguous using reference is not error
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org,swagiaal at redhat dot com
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=11540

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11540] ambiguous using reference is not error
  2010-04-26  7:30 [Bug c++/11540] New: ambiguous using reference is not error jan dot kratochvil at redhat dot com
@ 2010-04-29 21:05 ` swagiaal at redhat dot com
  2010-07-22 15:39 ` swagiaal at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: swagiaal at redhat dot com @ 2010-04-29 21:05 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|swagiaal at redhat dot com
                   |org                         |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=11540

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11540] ambiguous using reference is not error
  2010-04-26  7:30 [Bug c++/11540] New: ambiguous using reference is not error jan dot kratochvil at redhat dot com
  2010-04-29 21:05 ` [Bug c++/11540] " swagiaal at redhat dot com
@ 2010-07-22 15:39 ` swagiaal at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: swagiaal at redhat dot com @ 2010-07-22 15:39 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |11832


http://sourceware.org/bugzilla/show_bug.cgi?id=11540

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-07-22 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-26  7:30 [Bug c++/11540] New: ambiguous using reference is not error jan dot kratochvil at redhat dot com
2010-04-29 21:05 ` [Bug c++/11540] " swagiaal at redhat dot com
2010-07-22 15:39 ` swagiaal at redhat dot com

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