* [Bug c++/29131] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
@ 2006-09-18 17:28 ` pinskia at gcc dot gnu dot org
2006-09-19 3:47 ` pinskia at gcc dot gnu dot org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-18 17:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-09-18 17:28 -------
(In reply to comment #0)
> The C++ standard clause 14.6.3 states that names should be looked up from the
> point they are used. I.e. functions defined after that point are not visible.
> This is true for regular functions, but GCC does not get this right for
> template functions.
No you missed something but I don't have the standard in front of me.
14.6.3 is talking about something different. Anyways this is unqualified
function call that is dependent on a template arguments.
I think 14.6.3 is really talking about what PR 2922 is about and not this one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
2006-09-18 17:28 ` [Bug c++/29131] " pinskia at gcc dot gnu dot org
@ 2006-09-19 3:47 ` pinskia at gcc dot gnu dot org
2006-09-19 3:49 ` pinskia at gcc dot gnu dot org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19 3:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-09-19 03:47 -------
Actually wait, what is happening here is ADL is happening for fundemantal types
which is a question of a Defect report, I forgot which one now.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
2006-09-18 17:28 ` [Bug c++/29131] " pinskia at gcc dot gnu dot org
2006-09-19 3:47 ` pinskia at gcc dot gnu dot org
@ 2006-09-19 3:49 ` pinskia at gcc dot gnu dot org
2006-09-19 3:51 ` pinskia at gcc dot gnu dot org
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19 3:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-09-19 03:49 -------
Actually you missed 14.6.4.2. This really has nothing to do with 14.6.3.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (2 preceding siblings ...)
2006-09-19 3:49 ` pinskia at gcc dot gnu dot org
@ 2006-09-19 3:51 ` pinskia at gcc dot gnu dot org
2006-09-19 4:06 ` pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19 3:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2006-09-19 03:51 -------
Also "f (i)" is a dependent expression because of 14.6.2/1 as i is (obviously)
dependent so 14.6.3 does not apply.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (3 preceding siblings ...)
2006-09-19 3:51 ` pinskia at gcc dot gnu dot org
@ 2006-09-19 4:06 ` pinskia at gcc dot gnu dot org
2006-09-19 4:30 ` [Bug c++/29131] [DR 225] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19 4:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-09-19 04:06 -------
So GCC does not implement 14.6.4.2/1, part 1:
- For the part of look using unqualified name lookup (3.4.1), only function
declareations with external linkage from the template context are found.
And since ADL on fundalment types not exist, that is the only part that happens
so this is invalid code based on that and nothing else.
Next time becareful when trying to figuring out why something is invalid code
because it is easy to get it wrong and then have a someone else having to look
at the standard to prove you wrong. In fact the following is valid code
because of ADL (since template instantiation conext is also included for ADL):
template<class T>
int t(T i)
{
return f (i); // error: f not visible here
}
struct a{};
int
f (a i)
{
return 0;
}
int
main()
{
a b;
return t(b);
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-09-19 04:06:38
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (4 preceding siblings ...)
2006-09-19 4:06 ` pinskia at gcc dot gnu dot org
@ 2006-09-19 4:30 ` pinskia at gcc dot gnu dot org
2009-12-05 0:13 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-19 4:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-09-19 04:30 -------
This is DR 225 really.
http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#225
Which means there is a question if this is really invalid code after all.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |SUSPENDED
Summary|Bad name lookup for |[DR 225] Bad name lookup for
|templates |templates
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (5 preceding siblings ...)
2006-09-19 4:30 ` [Bug c++/29131] [DR 225] " pinskia at gcc dot gnu dot org
@ 2009-12-05 0:13 ` pinskia at gcc dot gnu dot org
2009-12-08 22:03 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-12-05 0:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2009-12-05 00:13 -------
*** Bug 42281 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jezz at hkfree dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (6 preceding siblings ...)
2009-12-05 0:13 ` pinskia at gcc dot gnu dot org
@ 2009-12-08 22:03 ` pinskia at gcc dot gnu dot org
2010-02-05 12:52 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to foundemtal types namespace for ADL paolo dot carlini at oracle dot com
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-12-08 22:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2009-12-08 22:02 -------
*** Bug 34886 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rvovsd at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates due to foundemtal types namespace for ADL.
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (7 preceding siblings ...)
2009-12-08 22:03 ` pinskia at gcc dot gnu dot org
@ 2010-02-05 12:52 ` paolo dot carlini at oracle dot com
2010-03-04 20:28 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-02-05 12:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from paolo dot carlini at oracle dot com 2010-02-05 12:52 -------
*** Bug 31816 has been marked as a duplicate of this bug. ***
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nicolas dot burrus at ensta
| |dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates due to foundemtal types namespace for ADL.
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (8 preceding siblings ...)
2010-02-05 12:52 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to foundemtal types namespace for ADL paolo dot carlini at oracle dot com
@ 2010-03-04 20:28 ` pinskia at gcc dot gnu dot org
2010-03-24 16:45 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental " pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-04 20:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from pinskia at gcc dot gnu dot org 2010-03-04 20:28 -------
*** Bug 43261 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |boostcpp at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL.
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (9 preceding siblings ...)
2010-03-04 20:28 ` pinskia at gcc dot gnu dot org
@ 2010-03-24 16:45 ` pinskia at gcc dot gnu dot org
2010-03-29 20:53 ` pinskia at gcc dot gnu dot org
2010-07-29 15:20 ` pinskia at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-24 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from pinskia at gcc dot gnu dot org 2010-03-24 16:45 -------
*** Bug 43506 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yao_yin at 163 dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL.
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (10 preceding siblings ...)
2010-03-24 16:45 ` [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental " pinskia at gcc dot gnu dot org
@ 2010-03-29 20:53 ` pinskia at gcc dot gnu dot org
2010-07-29 15:20 ` pinskia at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-29 20:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from pinskia at gcc dot gnu dot org 2010-03-29 20:53 -------
*** Bug 43506 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/29131] [DR 225] Bad name lookup for templates due to fundamental types namespace for ADL.
2006-09-18 16:39 [Bug c++/29131] New: Bad name lookup for templates andrew dot stubbs at st dot com
` (11 preceding siblings ...)
2010-03-29 20:53 ` pinskia at gcc dot gnu dot org
@ 2010-07-29 15:20 ` pinskia at gcc dot gnu dot org
12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-29 15:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from pinskia at gcc dot gnu dot org 2010-07-29 15:19 -------
*** Bug 45132 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |g_sauthoff at web dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29131
^ permalink raw reply [flat|nested] 14+ messages in thread