mizvekov added inline comments.

================
Comment at: clang/lib/Sema/SemaTemplate.cpp:1535-1545
+    if (TInfo->getType()->getContainedAutoType()) {
+      // template<auto xx>
+      Diag(D.getIdentifierLoc(),
+           diag::warn_cxx14_compat_template_nontype_parm_auto_type)
+          << QualType(TInfo->getType()->getContainedAutoType(), 0);
+    } else {
+      // template<DeducedClass dc>
----------------
This largely duplicates the effort from D132990

Your patch will also fix the crash fixed by D132990, and I even suggested there 
also handling deduced template specializations.

Two points about this change though:

* The new diagnosticis too generic and does not explain what the user did wrong.
* Please test for each case of AutoType and DeducedTemplateSpecializationType 
explicitly, and llvm_unreachable on anything else, so that when a new kind of 
DeducedType is added, we handle it with an appropriate message. This goes with 
the first bullet, if you know what each case is, you can produce more 
explanatory diagnostics.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133609/new/

https://reviews.llvm.org/D133609

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

Reply via email to