[Bug c++/16635] g++ instantiates templates at the wrong place
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635 Jonathan Wakely redi at gcc dot gnu.org changed: What|Removed |Added Known to fail|| --- Comment #16 from Jonathan Wakely redi at gcc dot gnu.org 2011-12-16 11:08:03 UTC --- (In reply to comment #15) I believe http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#993 will be resolved to allow the G++ behavior. Suspending. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#993 so this is INVALID?
[Bug c++/16635] g++ instantiates templates at the wrong place
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635 Jason Merrill jason at gcc dot gnu.org changed: What|Removed |Added Status|SUSPENDED |RESOLVED Resolution||INVALID --- Comment #17 from Jason Merrill jason at gcc dot gnu.org 2011-12-16 18:30:54 UTC --- Yep.
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #15 from jason at gcc dot gnu dot org 2010-01-06 19:40 --- I believe http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#993 will be resolved to allow the G++ behavior. Suspending. -- jason at gcc dot gnu dot org changed: What|Removed |Added CC||jason at gcc dot gnu dot org Status|NEW |SUSPENDED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #14 from pinskia at gcc dot gnu dot org 2009-12-05 00:10 --- *** Bug 42292 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||wan at google dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #13 from pinskia at gcc dot gnu dot org 2009-01-09 20:27 --- *** Bug 38762 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||dougrm at sprynet dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #12 from pinskia at gcc dot gnu dot org 2008-08-29 03:47 --- *** Bug 37225 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||gdr at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #11 from pinskia at gcc dot gnu dot org 2008-04-03 02:51 --- *** Bug 35799 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||peter at empeg dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Comment #10 from andrew dot stubbs at st dot com 2007-05-31 10:57 --- Here's another issue in this area. Is it the same, or a separate bug? This code is adapted from the example in DR197. #include stdio.h struct C1 {}; struct C2 : C1 { }; C1 c1; C2 c2; void f(C1); template class T void g(T t) { f(c2); // f(C1) should be the nearest match f(t); // dependent } void f(C2); int main() { g(c2); // will cause one call of f(C1) followed // by one calls of f(C2) g(c1); // will cause two calls of f(C1) } void f(C1) { printf (C1\n);} void f(C2) { printf (C2\n);} What actually happens (with the 4.1.1 I have anyway) is three calls to f(C2) followed by one call to f(C1). This shows that the *non-dependent* call is being resolved in the wrong scope also - it should not be able to see f(C2). If the prototype for f(C2) is removed, then the previously described problem is apparent also, and the (incorrect) behaviour of the program is unchanged. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-23 01:19 --- (In reply to comment #5) Here's the same thing with overloaded functions, causing a wrong-code error. If the last definition of 'bar' is commented out, the testcase passes, but otherwise not. That code is acutally invalid and really should have been rejected see PR 2922 for that. -- What|Removed |Added Keywords|wrong-code | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-23 01:27 --- (In reply to comment #6) (In reply to comment #5) Here's the same thing with overloaded functions, causing a wrong-code error. If the last definition of 'bar' is commented out, the testcase passes, but otherwise not. That code is acutally invalid and really should have been rejected see PR 2922 for that. Also if we move the template func after bar and main after the second bar, we get back to basicially PR 2922. So the first testcase is the only one which the problem for this bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635
[Bug c++/16635] g++ instantiates templates at the wrong place
--- Additional Comments From geoffk at gcc dot gnu dot org 2005-04-26 06:53 --- Here's the same thing with overloaded functions, causing a wrong-code error. If the last definition of 'bar' is commented out, the testcase passes, but otherwise not. template class T int func(T x) { return bar (x); } int bar(const int x) { return x; } extern C void abort (); int main (void) { int x = 3; if (funcint(x) != 3) abort (); } int bar (int x) { return x + 3; } -- What|Removed |Added Keywords||wrong-code Known to fail||3.3 4.0.0 Summary|g++ doesn't diagnose|g++ instantiates templates |instantiation of template |at the wrong place |that uses incomplete type | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635