diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-30 19:14:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-30 19:14:50 +0000 |
commit | 040afaeea2313dc69fd532995ac88cccdd62da56 (patch) | |
tree | eb9f4dee0339f0953344078c3674f120165a73d0 /test/ASTMerge | |
parent | 7907fad723a0f4764a2396df620d9c58725b3053 (diff) |
Implement basic AST importing and merging support for class template
declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge')
-rw-r--r-- | test/ASTMerge/Inputs/class-template1.cpp | 21 | ||||
-rw-r--r-- | test/ASTMerge/Inputs/class-template2.cpp | 20 | ||||
-rw-r--r-- | test/ASTMerge/class-template.cpp | 15 |
3 files changed, 56 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/class-template1.cpp b/test/ASTMerge/Inputs/class-template1.cpp new file mode 100644 index 0000000000..0f40309160 --- /dev/null +++ b/test/ASTMerge/Inputs/class-template1.cpp @@ -0,0 +1,21 @@ +template<typename T> +struct X0; + +template<int I> +struct X1; + +template<int I> +struct X2; + +template<int I> +struct X3; + +template<template<int I> class> +struct X4; + +template<template<long> class> +struct X5; + +template<typename> +struct X6; + diff --git a/test/ASTMerge/Inputs/class-template2.cpp b/test/ASTMerge/Inputs/class-template2.cpp new file mode 100644 index 0000000000..5eecf9e6c1 --- /dev/null +++ b/test/ASTMerge/Inputs/class-template2.cpp @@ -0,0 +1,20 @@ +template<class T> +struct X0; + +template<int I> +struct X1; + +template<long I> +struct X2; + +template<typename> +struct X3; + +template<template<int I> class> +struct X4; + +template<template<int I> class> +struct X5; + +template<template<int I> class> +struct X6; diff --git a/test/ASTMerge/class-template.cpp b/test/ASTMerge/class-template.cpp new file mode 100644 index 0000000000..847c9569e5 --- /dev/null +++ b/test/ASTMerge/class-template.cpp @@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/class-template1.cpp +// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/class-template2.cpp +// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s + +// CHECK: class-template1.cpp:7:14: error: non-type template parameter declared with incompatible types in different translation units ('int' vs. 'long') +// CHECK: class-template2.cpp:7:15: note: declared here with type 'long' + +// CHECK: class-template1.cpp:10:14: error: template parameter has different kinds in different translation units +// CHECK: class-template2.cpp:10:10: note: template parameter declared here + +// CHECK: class-template1.cpp:16:23: error: non-type template parameter declared with incompatible types in different translation units ('long' vs. 'int') +// CHECK: class-template2.cpp:16:23: note: declared here with type 'int' + +// CHECK: class-template1.cpp:19:10: error: template parameter has different kinds in different translation units +// CHECK: class-template2.cpp:19:10: note: template parameter declared here |