[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 25 15:09:32 PDT 2018
erik.pilkington added inline comments.
================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:143
TSK_ExplicitSpecialization &&
!Function->getClassScopeSpecializationPattern()))
break;
----------------
It looks like theres a bug here too:
```
template <class T> struct S {
template <class T> void f() {}
template <> void f<int>() {}
};
```
Will lead to a depth-2 MultiLevelTemplateArgumentList for f<int>, but I believe there should only be 1 level. I don't think theres any way to observe this though.
================
Comment at: clang/test/SemaCXX/member-spec-dr727.cpp:35
+ static_assert(is_same<Cp, int>::value);
+ static_assert(is_same<Ap, char>::value);
+ };
----------------
This fails on TOT because clang substitutes `int` for `Ap`!
Repository:
rC Clang
https://reviews.llvm.org/D52521
More information about the cfe-commits
mailing list