diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/PCH/Inputs/chain-cxx1.h | 6 | ||||
-rw-r--r-- | clang/test/PCH/Inputs/chain-cxx2.h | 12 | ||||
-rw-r--r-- | clang/test/PCH/chain-cxx.cpp | 7 |
3 files changed, 23 insertions, 2 deletions
diff --git a/clang/test/PCH/Inputs/chain-cxx1.h b/clang/test/PCH/Inputs/chain-cxx1.h index 747bdbc7f42..7ea3ffb61c8 100644 --- a/clang/test/PCH/Inputs/chain-cxx1.h +++ b/clang/test/PCH/Inputs/chain-cxx1.h @@ -12,4 +12,8 @@ namespace ns { } template <typename T> -struct S {}; +struct S { typedef int G; }; + +// Partially specialize +template <typename T> +struct S<T *> { typedef int H; }; diff --git a/clang/test/PCH/Inputs/chain-cxx2.h b/clang/test/PCH/Inputs/chain-cxx2.h index ff22e538d4d..adc10fd8368 100644 --- a/clang/test/PCH/Inputs/chain-cxx2.h +++ b/clang/test/PCH/Inputs/chain-cxx2.h @@ -18,3 +18,15 @@ namespace ns { // Specialize template from primary template <> struct S<int> { typedef int I; }; + +// Partially specialize +template <typename T> +struct S<T &> { typedef int J; }; + +// Specialize previous partial specialization +template <> +struct S<int *> { typedef int K; }; + +// Specialize the partial specialization from this file +template <> +struct S<int &> { typedef int L; }; diff --git a/clang/test/PCH/chain-cxx.cpp b/clang/test/PCH/chain-cxx.cpp index 450a7918286..3e46214c70b 100644 --- a/clang/test/PCH/chain-cxx.cpp +++ b/clang/test/PCH/chain-cxx.cpp @@ -19,5 +19,10 @@ void test() { ns::pg(); ns::g2(); - //typedef S<int>::I J; + typedef S<double>::G T1; + typedef S<double *>::H T2; + typedef S<int>::I T3; + typedef S<double &>::J T4; + typedef S<int *>::K T5; + typedef S<int &>::L T6; } |