namespace ns {template <typename> struct S {}; }
using ns::$explicit^S;)cpp",
"^S<int> x;");
+ testWalk(R"cpp(
+ namespace ns {
+ template <typename T> struct S { S(T);};
+ template <typename T> S(T t) -> S<T>;
+ }
+ using ns::$explicit^S;)cpp",
+ "^S x(123);");
testWalk("template<typename> struct $explicit^S {};",
R"cpp(
template <template <typename> typename> struct X {};
}
void TemplateName::Profile(llvm::FoldingSetNodeID &ID) {
- if (auto *TD = getAsTemplateDecl())
+ if (const auto* USD = getAsUsingShadowDecl())
+ ID.AddPointer(USD->getCanonicalDecl());
+ else if (const auto *TD = getAsTemplateDecl())
ID.AddPointer(TD->getCanonicalDecl());
else
ID.AddPointer(Storage.getOpaqueValue());
public:
S(T);
};
+template<typename T> struct S2 { S2(T); };
+template <typename T> S2(T t) -> S2<T>;
}
using ns::S;
+using ns::S2;
// TemplateName in TemplateSpecializationType.
template<typename T>
// CHECK-NEXT: |-DeclRefExpr {{.*}}
// CHECK-NEXT: `-ElaboratedType {{.*}} 'S<int>' sugar
// CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'ns::S<int>' sugar using
+
+S2 DeducedTemplateSpecializationT2(123);
+using D = decltype(DeducedTemplateSpecializationT2);
+// CHECK: DecltypeType {{.*}}
+// CHECK-NEXT: |-DeclRefExpr {{.*}}
+// CHECK-NEXT: `-ElaboratedType {{.*}} 'S2<int>' sugar
+// CHECK-NEXT: `-DeducedTemplateSpecializationType {{.*}} 'S2<int>' sugar using