public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35139] New: g++ rejects valid code
@ 2008-02-08 13:59 tim at klingt dot org
2008-02-08 14:01 ` [Bug c++/35139] " tim at klingt dot org
0 siblings, 1 reply; 2+ messages in thread
From: tim at klingt dot org @ 2008-02-08 13:59 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
g++-4.3 rejects the following code:
namespace n1 {
struct foo{};
}
namespace n2 {
struct foo{};
}
using namespace n1;
using namespace n2;
template <typename tp>
int run(tp const & t) {
return t.foo;
}
struct bar {
int foo;
};
int main() {
bar b;
run(b);
}
the error message is:
bug.cpp: In function âint run(const tp&)â:
bug.cpp:14: error: reference to âfooâ is ambiguous
bug.cpp:6: error: candidates are: struct n2::foo
bug.cpp:2: error: struct n1::foo
g++-4.1 and g++-4.2 accept the code, though ...
--
Summary: g++ rejects valid code
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tim at klingt dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35139
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/35139] g++ rejects valid code
2008-02-08 13:59 [Bug c++/35139] New: g++ rejects valid code tim at klingt dot org
@ 2008-02-08 14:01 ` tim at klingt dot org
0 siblings, 0 replies; 2+ messages in thread
From: tim at klingt dot org @ 2008-02-08 14:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from tim at klingt dot org 2008-02-08 14:01 -------
*** This bug has been marked as a duplicate of 35138 ***
--
tim at klingt dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35139
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-08 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 13:59 [Bug c++/35139] New: g++ rejects valid code tim at klingt dot org
2008-02-08 14:01 ` [Bug c++/35139] " tim at klingt dot 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).