vsapsai added inline comments.

================
Comment at: Parse/ParseTemplate.cpp:492
+  // Is there just a typo in the input code? ('typedef' instead of 'typename')
+  if (Tok.is(tok::kw_typedef)) {
+    Diag(Tok.getLocation(), diag::err_expected_template_parameter);
----------------
How does it work when you have `typedef` for the first template parameter?


================
Comment at: Parser/typedef-instead-of-typename-typo.hpp:3
+
+template <typename A, typedef B> struct Foo {
+  a
----------------
Maybe put this test in clang/test/FixIt ?

Also please check what file extensions are used for testing templates. .hpp 
reflects real-life usage but  most tests are .cpp. Or maybe I wasn't paying 
attention.


================
Comment at: Parser/typedef-instead-of-typename-typo.hpp:5
+  a
+}; // CHECK: expected-error{{expected template parameter}} \
+// CHECK: expected-note{{Did you mean to use 'typename'?}} \
----------------
It is a little bit confusing to what lines the messages would be attributed to. 
Need to check locally because not sure I interpret all those backslashes the 
same way lit does.

Also idea for the test. To check that the fix-it was applied properly you can 
add a member like `B b;` and it shouldn't trigger any errors.


================
Comment at: clang/Basic/DiagnosticParseKinds.td:1167
+def note_meant_to_use_typename : Note<
+  "Did you mean to use 'typename'?">;
 }
----------------
Looks like other diagnostic messages "did you mean to use …" have lowercase "d" 
in "did". Though I haven't checked how it looks in various situations.


https://reviews.llvm.org/D42170



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to