[PATCH] Avoid spurious error messages if parent template class cannot be instantiated
Richard Smith
richard at metafoo.co.uk
Thu Jun 6 01:04:08 PDT 2013
================
Comment at: lib/Parse/ParseDeclCXX.cpp:920-924
@@ -919,4 +919,7 @@
- if (!Template)
+ if (!Template) {
+ SkipUntil(tok::greater, tok::greatergreater, /*StopAtSemi=*/true,
+ /*DontConsume=*/false);
return true;
+ }
----------------
This recovery is not quite right.
template<typename,typename> struct X {};
struct A : Unknown<X<int,int>, X<int,int>> {
};
will treat the second `X<int,int>` as a base class, not as more of the template arguments to `Unknown`. Also, what about `tok::greatergreatergreater`? :)
http://llvm-reviews.chandlerc.com/D924
More information about the cfe-commits
mailing list