aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-template-decl.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-04-02 19:15:28 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-04-02 19:15:28 +0000
commit460ef136eb96b879f149c8703938a13c35b4bc68 (patch)
treee43369d9349e529c2472ce39949b9378302675ec /test/Parser/cxx-template-decl.cpp
parente7d0bbfa101d0f0b955c04c417b5e3283497a7ed (diff)
Correct error recovery when missing 'class' in a template template parameter.
The diagnostic message correctly informs the user that they have omitted the 'class' keyword, but neither suggests this insertion as a fixit, nor attempts to recover as if they had provided the keyword. This fixes the recovery, adds the fixit, and adds a separate diagnostic and corresponding replacement fixit for cases where the user wrote 'struct' or 'typename' instead of 'class' (suggested by Richard Smith as a possible common mistake). I'm not sure the diagnostic message for either the original or new cases feel very Clang-esque, so I'm open to suggestions there. The fixit hints make it fairly easy to see what's required, though. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-template-decl.cpp')
-rw-r--r--test/Parser/cxx-template-decl.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index 4717dbb7dc..72f2d7d15d 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/test/Parser/cxx-template-decl.cpp
@@ -11,10 +11,8 @@ template < ; // expected-error {{parse error}} \
// expected-warning {{declaration does not declare anything}}
template <template X> struct Err1; // expected-error {{expected '<' after 'template'}} \
// expected-error{{extraneous}}
-template <template <typename> > struct Err2; // expected-error {{expected 'class' before '>'}} \
-// expected-error{{extraneous}}
-template <template <typename> Foo> struct Err3; // expected-error {{expected 'class' before 'Foo'}} \
-// expected-error{{extraneous}}
+template <template <typename> > struct Err2; // expected-error {{expected 'class' before '>'}}
+template <template <typename> Foo> struct Err3; // expected-error {{expected 'class' before 'Foo'}}
// Template function declarations
template <typename T> void foo();