[PATCH] PR10405 Missing actual type (aka) in error message when using decltype as a template parameter

Nikola Smiljanić popizdeh at gmail.com
Mon Jun 30 23:07:17 PDT 2014


================
Comment at: lib/AST/ASTDiagnostic.cpp:70-81
@@ -69,5 +69,14 @@
+    // or decltype appears anywhere in the type.
     if (const TemplateSpecializationType *TST
-          = dyn_cast<TemplateSpecializationType>(Ty))
-      if (!TST->isTypeAlias())
+        = dyn_cast<TemplateSpecializationType>(Ty)) {
+      for (auto Arg : *TST) {
+          if (Arg.getKind() == TemplateArgument::Type)
+              Desugar(Context, Arg.getAsType(), ShouldAKA);
+          if (ShouldAKA)
+              break;
+      }
+
+      if (!ShouldAKA && !TST->isTypeAlias())
         break;
+    }
 
----------------
Richard Smith wrote:
> It'd be better here to rebuild a TemplateSpecializationType that has the desugared template arguments in it.
What exactly do you mean by **rebuild**?

http://reviews.llvm.org/D3588






More information about the cfe-commits mailing list