public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/16233] New: Bad diagnostic @ 2004-06-27 17:25 igodard at pacbell dot net 2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org ` (3 more replies) 0 siblings, 4 replies; 5+ messages in thread From: igodard at pacbell dot net @ 2004-06-27 17:25 UTC (permalink / raw) To: gcc-bugs template<typename T> struct A { template<typename U> void Foo(){} }; template<typename V>struct B { void Bar(V* v) { v->template Foo<int>(); v->Foo<int>(); } }; int main() { A<bool> a; B<A<bool> > b; b.Bar(&a); } gets you: ~/ootbc/common/test/src$ g++ foo.cc foo.cc: In member function `void B<V>::Bar(V*)': foo.cc:6: error: expected primary-expression before "int" foo.cc:6: error: expected `;' before "int" The actual problem is the missing explicit "template" qualification. Surely the compiler can recognize "<int>" as a template argument list in this case. I grant that templates with data elements cannot be recognized in such a context: -- Summary: Bad diagnostic Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: igodard at pacbell dot net CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16233] Bad diagnostic 2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net @ 2004-06-27 17:48 ` pinskia at gcc dot gnu dot org 2004-06-27 17:53 ` pinskia at gcc dot gnu dot org ` (2 subsequent siblings) 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:48 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:41 ------- *** This bug has been marked as a duplicate of 16232 *** -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16233] Bad diagnostic 2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net 2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org @ 2004-06-27 17:53 ` pinskia at gcc dot gnu dot org 2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org 2004-06-27 18:09 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:53 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:49 ------- Opps I was not looking to closly. -- What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|DUPLICATE | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted 2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net 2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org 2004-06-27 17:53 ` pinskia at gcc dot gnu dot org @ 2004-06-27 17:55 ` pinskia at gcc dot gnu dot org 2004-06-27 18:09 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-06-27 17:55 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 17:53 ------- Confirmed, here is shorter example: template<typename V> void B(V a) { a.Foo<int> (); } -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |diagnostic Last reconfirmed|0000-00-00 00:00:00 |2004-06-27 17:53:41 date| | Summary|Bad diagnostic |unhelpful error message when | |"template" is omitted http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/16233] unhelpful error message when "template" is omitted 2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net ` (2 preceding siblings ...) 2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org @ 2004-06-27 18:09 ` pinskia at gcc dot gnu dot org 3 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-06-27 18:09 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-06-27 18:09 ------- *** Bug 16234 has been marked as a duplicate of this bug. *** -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16233 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-06-27 18:09 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-06-27 17:25 [Bug c++/16233] New: Bad diagnostic igodard at pacbell dot net 2004-06-27 17:48 ` [Bug c++/16233] " pinskia at gcc dot gnu dot org 2004-06-27 17:53 ` pinskia at gcc dot gnu dot org 2004-06-27 17:55 ` [Bug c++/16233] unhelpful error message when "template" is omitted pinskia at gcc dot gnu dot org 2004-06-27 18:09 ` 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).