[PATCH] PR10405 Missing actual type (aka) in error message when using decltype as a template parameter
Richard Smith
richard at metafoo.co.uk
Tue Jul 8 10:52:53 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;
+ }
----------------
Nikola Smiljanić wrote:
> 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**?
I mean, ask the ASTContext to create a new TemplateSpecializationType with the desugared template arguments.
http://reviews.llvm.org/D3588
More information about the cfe-commits
mailing list