Priority: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ke...@fry-it.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
Keean Schupke changed:
What|Removed |Added
CC||ke...@fry-it.com
--- Comment #1 from
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #2 from Keean Schupke 2012-06-04 13:33:38 UTC ---
The function called in the template definition is clearly dependent on the
template parameter 'T' and therefore itsname should be resolved at the point of
instantiation where 'g' is cle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #3 from Keean Schupke 2012-06-04 13:44:14 UTC ---
From: Technicalities C.13.8.3:
" struct X { X(int); /* ... */ };
"
" void g(X);
"
" template void f(T a) { g(a); }
"
" void h()
" {
" extern void g(int);
" f(2);
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #4 from Keean Schupke 2012-06-04 16:38:21 UTC ---
From C++ Standard N3242=11-0012 14.6 Name Resolution
10. If a name does not depend on a template-parameter (as deļ¬ned in 14.6.2), a
declaration (or set of declarations) for that name s
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #5 from Keean Schupke 2012-06-04 17:13:18 UTC ---
The following program will apparently compile correctly, but will silently
produce incorrect results at runtime:
#include
char g(char x) {
return x - 1;
}
template T f(T t) {
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #6 from Keean Schupke 2012-06-05 09:06:01 UTC ---
The suggested work around in the error message 'adding -fpermissive' to
gcc-4.7.0 does not fix the problem as suggested by the error message. This
would suggest the compiler is not disp
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #8 from Keean Schupke 2012-06-05 10:15:18 UTC ---
(In reply to comment #7)
Have a read of the C++ standard, the example given in:
N3242=11-0012 14.6 Name Resolution: paragraph 10
Which I have pasted above into comment #4 and the extr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #11 from Keean Schupke 2012-06-05 11:07:14 UTC
---
(In reply to comment #9)
Can you point me at where in the specification this is defined?
> (In reply to comment #2)
> > The function called in the template definition is clearly d
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #12 from Keean Schupke 2012-06-05 11:14:00 UTC
---
(In reply to comment #10)
although -fpermissive allows the code to compile (in some circumstances) it
does not in all, and it also produces incorrect output, for example:
#include
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #13 from Keean Schupke 2012-06-05 11:25:40 UTC
---
(In reply to comment #9)
>From ISO14882 14.6 - Name resolution [temp.res]
-8- When looking for the declaration of a name used in a template definition,
the usual lookup rules (basic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #16 from Keean Schupke 2012-06-05 11:53:32 UTC
---
(In reply to comment #14)
Basic.lookup.argdep is not specific to templates, so why does the dependent
lookup work outside of templates?
int g(int x) {
return x - 1;
}
double g(
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #19 from Keean Schupke 2012-06-05 12:55:06 UTC
---
(In reply to comment #18)
Sorry about that. It does indeed seem that the combination of [temp.dep.res]
and [basic.lookup.argdep] imply this behaviour. I think my point was more about
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #21 from Keean Schupke 2012-06-05 17:01:01 UTC
---
(In reply to comment #20)
Yes, once again sorry. Obviously not GCC's problem for implementing the
standard correctly, but this causes problems producing elegant datatype generic
code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53573
--- Comment #23 from Keean Schupke 2012-06-27 06:48:28 UTC
---
(In reply to comment #22)
> (In reply to comment #21)
> > Is there any chance this 'feature' of GCC could be kept as a g++ specific
> > extension in 'gnu++11' mode, as I think the old
: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ke...@fry-it.com
: P3
Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: ke...@fry-it.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52065
Keean Schupke changed:
What|Removed |Added
CC||ke...@fry-it.com
Summary
18 matches
Mail list logo