[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / chain-friend-instantiation.cpp
blob2f042a8341ec5e8d47dc485c8e79ba023e60f61f
1 // RUN: %clang_cc1 %s -ast-print -o - -chain-include %s -chain-include %s
2 // RUN: %clang_cc1 %s -ast-print -o - -fmodules -chain-include %s -chain-include %s
4 #if !defined(PASS1)
5 #define PASS1
7 template <class T> class TClass;
9 namespace NS {
10 template <class X, class Y> TClass<X> problematic(X * ptr, const TClass<Y> &src);
12 template <class T>
13 class TBaseClass
15 protected:
16 template <class X, class Y> friend TClass<X> problematic(X * ptr, const TClass<Y> &src);
20 template <class T>
21 class TClass: public NS::TBaseClass<T>
23 public:
24 inline TClass() { }
28 namespace NS {
29 template <class X, class T>
30 TClass<X> problematic(X *ptr, const TClass<T> &src);
33 template <class X, class T>
34 TClass<X> unconst(const TClass<T> &src);
36 #elif !defined(PASS2)
37 #define PASS2
39 namespace std {
40 class s {};
44 typedef TClass<std::s> TStr;
46 struct crash {
47 TStr str;
49 crash(const TClass<std::s> p)
51 unconst<TStr>(p);
55 #else
57 void f() {
58 const TStr p;
59 crash c(p);
62 #endif