File tree Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -402,6 +402,7 @@ Bug Fixes in This Version
402
402
when using the ``INTn_C `` macros. (#GH85995)
403
403
- Fixed an assertion failure in the expansion of builtin macros like ``__has_embed() `` with line breaks before the
404
404
closing paren. (#GH133574)
405
+ - Fixed a crash in error recovery for expressions resolving to templates. (#GH135621)
405
406
- Clang no longer accepts invalid integer constants which are too large to fit
406
407
into any (standard or extended) integer type when the constant is unevaluated.
407
408
Merely forming the token is sufficient to render the program invalid. Code
@@ -544,7 +545,7 @@ Arm and AArch64 Support
544
545
^^^^^^^^^^^^^^^^^^^^^^^
545
546
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
546
547
- The ``+nosimd `` attribute is now fully supported for ARM. Previously, this had no effect when being used with
547
- ARM targets, however this will now disable NEON instructions being generated. The ``simd `` option is
548
+ ARM targets, however this will now disable NEON instructions being generated. The ``simd `` option is
548
549
also now printed when the ``--print-supported-extensions `` option is used.
549
550
550
551
- Support for __ptrauth type qualifier has been added.
Original file line number Diff line number Diff line change @@ -4583,7 +4583,8 @@ TemplateSpecializationType::TemplateSpecializationType(
4583
4583
T.getKind () == TemplateName::SubstTemplateTemplateParmPack ||
4584
4584
T.getKind () == TemplateName::UsingTemplate ||
4585
4585
T.getKind () == TemplateName::QualifiedTemplate ||
4586
- T.getKind () == TemplateName::DeducedTemplate) &&
4586
+ T.getKind () == TemplateName::DeducedTemplate ||
4587
+ T.getKind () == TemplateName::AssumedTemplate) &&
4587
4588
" Unexpected template name for TemplateSpecializationType" );
4588
4589
4589
4590
auto *TemplateArgs =
Original file line number Diff line number Diff line change @@ -25259,11 +25259,15 @@ ExprResult Sema::CheckPlaceholderExpr(Expr *E) {
25259
25259
const bool IsTypeAliasTemplateDecl = isa<TypeAliasTemplateDecl>(Temp);
25260
25260
25261
25261
NestedNameSpecifier *NNS = ULE->getQualifierLoc().getNestedNameSpecifier();
25262
- TemplateName TN(dyn_cast<TemplateDecl>(Temp));
25263
- if (TN.isNull())
25262
+ // FIXME: AssumedTemplate is not very appropriate for error recovery here,
25263
+ // as it models only the unqualified-id case, where this case can clearly be
25264
+ // qualified. Thus we can't just qualify an assumed template.
25265
+ TemplateName TN;
25266
+ if (auto *TD = dyn_cast<TemplateDecl>(Temp))
25267
+ TN = Context.getQualifiedTemplateName(NNS, ULE->hasTemplateKeyword(),
25268
+ TemplateName(TD));
25269
+ else
25264
25270
TN = Context.getAssumedTemplateName(NameInfo.getName());
25265
- TN = Context.getQualifiedTemplateName(NNS,
25266
- /*TemplateKeyword=*/true, TN);
25267
25271
25268
25272
Diag(NameInfo.getLoc(), diag::err_template_kw_refers_to_type_template)
25269
25273
<< TN << ULE->getSourceRange() << IsTypeAliasTemplateDecl;
Original file line number Diff line number Diff line change @@ -67,3 +67,14 @@ namespace test1 {
67
67
// expected-note@#defined-here {{defined here}}
68
68
void NonTemplateClass::UndeclaredMethod () {}
69
69
}
70
+
71
+ namespace GH135621 {
72
+ template <class T > struct S {};
73
+ // expected-note@-1 {{class template declared here}}
74
+ template <class T2 > void f () {
75
+ S<T2>::template S<int >;
76
+ // expected-error@-1 {{'S' is expected to be a non-type template, but instantiated to a class template}}
77
+ }
78
+ template void f<int >();
79
+ // expected-note@-1 {{requested here}}
80
+ } // namespace GH135621
You can’t perform that action at this time.
0 commit comments