public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11296] New: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1
@ 2003-06-23 18:18 sebor at roguewave dot com
2003-06-24 2:14 ` [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1) giovannibajo at libero dot it
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: sebor at roguewave dot com @ 2003-06-23 18:18 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11296
Summary: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
CC: gcc-bugs at gcc dot gnu dot org
The program below is expected to exit with a status of 0. Only symbols from the
definition context are to be considered during unqualified lookup (bullet 1),
and only symbols defined in associated namespaces in both the definition and
instantiation context are to be considered during Koenig lookup (bullet 2). When
compiled with gcc 3.2, the program returns 1 instead, indicating that gcc fails
to correctly implement 14.6.4.2, p1, bullet 1 in that it considers symbols
outside the definition context of N::bar during unqualified lookup. EDG eccp -A
(i.e., strict mode) implements the rules correctly. For a discussion of the
rules see the email thread at c++std-core@research.att.com starting with
c++std-core-10009.
$ cat t.cpp; g++ -static t.cpp && ./a.out ; echo $?
namespace N {
template <class T> T foo (T) { return T (); }
template <class T> T bar (T t) { return foo (t); }
}
struct S { S (int i = 0): i_ (i) { } int i_; };
namespace N {
/* template <> */ S foo (S) { return S (1); }
}
int main ()
{
return 1 == N::bar (S ()).i_;
}
1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1)
2003-06-23 18:18 [Bug c++/11296] New: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1 sebor at roguewave dot com
@ 2003-06-24 2:14 ` giovannibajo at libero dot it
2003-07-29 22:05 ` pinskia at physics dot uc dot edu
2004-07-29 5:16 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2003-06-24 2:14 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11296
giovannibajo at libero dot it changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2003-06-24 02:14:29
date| |
Summary|gcc 3.2 fails to honor |Unqualified lookup should
|14.6.4.2, p1, bullet 1 |only use the definition
| |context, if the funciton
| |call is dependent
| |(§14.6.4.2, p1, bullet 1)
------- Additional Comments From giovannibajo at libero dot it 2003-06-24 02:14 -------
Confirmed. In other words, GCC incorrectly picks the second N::foo() because it
lookups all the functions available at the point of call, while it should only
use the definition context to lookup the function names for unqualified lookup.
This would make it call the first N::foo().
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1)
2003-06-23 18:18 [Bug c++/11296] New: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1 sebor at roguewave dot com
2003-06-24 2:14 ` [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1) giovannibajo at libero dot it
@ 2003-07-29 22:05 ` pinskia at physics dot uc dot edu
2004-07-29 5:16 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-29 22:05 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11296
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1)
2003-06-23 18:18 [Bug c++/11296] New: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1 sebor at roguewave dot com
2003-06-24 2:14 ` [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1) giovannibajo at libero dot it
2003-07-29 22:05 ` pinskia at physics dot uc dot edu
@ 2004-07-29 5:16 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-29 5:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-29 05:16 -------
This is another dup of bug 2922.
*** This bug has been marked as a duplicate of 2922 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11296
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-29 5:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-23 18:18 [Bug c++/11296] New: gcc 3.2 fails to honor 14.6.4.2, p1, bullet 1 sebor at roguewave dot com
2003-06-24 2:14 ` [Bug c++/11296] Unqualified lookup should only use the definition context, if the funciton call is dependent (§14.6.4.2, p1, bullet 1) giovannibajo at libero dot it
2003-07-29 22:05 ` pinskia at physics dot uc dot edu
2004-07-29 5:16 ` pinskia at gcc dot gnu 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).