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
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index 9ed4f3b..c881c63 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -199,3 +199,8 @@
expected-error {{missing 'typename' prior to dependent}}
return Mystery<T>::get();
}
+
+template<template<typename> Foo, // expected-error {{expected 'class' before 'Foo'}}
+ template<typename> typename Bar, // expected-error {{expected 'class' instead of 'typename'}}
+ template<typename> struct Baz> // expected-error {{expected 'class' instead of 'struct'}}
+void func();