[PATCH] D132990: [Clang] Fix compat diagnostic to detect a nontype template parameter has a placeholder type using getContainedAutoType()

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 2 12:17:38 PDT 2022


aaron.ballman added a comment.

Can you also add a release note for the changes?



================
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);
----------------
Let's get fancy!


================
Comment at: clang/test/SemaTemplate/temp_arg_nontype_diagnostic_cxx1z.cpp:1
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 -Wpre-c++17-compat %s
+
----------------
Please rename the file to end in cxx17 instead of cxx1z :-)


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

https://reviews.llvm.org/D132990



More information about the cfe-commits mailing list