mizvekov added inline comments.

================
Comment at: clang/lib/Sema/SemaTemplate.cpp:1534-1538
+  if (const auto *T = TInfo->getType()->getContainedDeducedType())
+    if (isa<AutoType>(T))
+      Diag(D.getIdentifierLoc(),
+           diag::warn_cxx14_compat_template_nontype_parm_auto_type)
+          << QualType(TInfo->getType()->getContainedAutoType(), 0);
----------------
aaron.ballman wrote:
> Let's get fancy!
You would use `getContainedDeducedType` if you expected to handle DeducedTypes 
in general, not just AutoTypes.

So if you only want to handle AutoTypes, there is no point in using 
`getContainedDeducedType`.


================
Comment at: clang/test/SemaTemplate/temp_arg_nontype_diagnostic_cxx1z.cpp:3-8
+namespace GH57362 {
+template <auto n> // expected-warning {{non-type template parameters declared 
with 'auto' are incompatible with C++ standards before C++17}}
+struct A{};
+
+template <decltype(auto) n> // expected-warning {{non-type template parameters 
declared with 'decltype(auto)' are incompatible with C++ standards before 
C++17}}
+struct B{};
----------------
I don't understand why these cases are grouped under GH57362 issue, they are 
cases that worked fine without this patch, we just didn't have tests for them.


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

https://reviews.llvm.org/D132990

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

Reply via email to