diff options
author | Richard Trieu <rtrieu@google.com> | 2014-07-26 02:10:52 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-07-26 02:10:52 +0000 |
commit | 97bacec221dbaffa74825a180efaa6684a65f6d9 (patch) | |
tree | c980a878b60df6a9b1aff88d86f716ab52a625c0 /clang/test/Misc/diag-template-diffing.cpp | |
parent | 1bf4d19172879e42eeb595e6337e8b358f6469c9 (diff) | |
download | bcm5719-llvm-97bacec221dbaffa74825a180efaa6684a65f6d9.tar.gz bcm5719-llvm-97bacec221dbaffa74825a180efaa6684a65f6d9.zip |
If a template argument is non-evaluable expression, use the profile ID to see
if the two arguments are equal.
llvm-svn: 214008
Diffstat (limited to 'clang/test/Misc/diag-template-diffing.cpp')
-rw-r--r-- | clang/test/Misc/diag-template-diffing.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/Misc/diag-template-diffing.cpp b/clang/test/Misc/diag-template-diffing.cpp index 32d67b93909..bdd6d62fdda 100644 --- a/clang/test/Misc/diag-template-diffing.cpp +++ b/clang/test/Misc/diag-template-diffing.cpp @@ -1212,6 +1212,41 @@ A<int> a2 = A<bool>(); // CHECK-ELIDE-NOTREE: no viable conversion from 'A<bool>' to 'A<int>' } +namespace TypeAlias { +template <int, int = 0> class A {}; + +template <class T> using a = A<T::num, 0>; +template <class T> using a = A<T::num>; + +template <class T> using A1 = A<T::num>; +template <class T> using A1 = A<T::num + 0>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<T::num + 0>' vs 'A<T::num>') + +template <class T> using A2 = A<1 + T::num>; +template <class T> using A2 = A<T::num + 1>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<T::num + 1>' vs 'A<1 + T::num>') + +template <class T> using A3 = A<(T::num)>; +template <class T> using A3 = A<T::num>; +// CHECK-ELIDE-NOTREE: error: type alias template redefinition with different types ('A<T::num>' vs 'A<(T::num)>') + + template <class T> using A4 = A<(T::num)>; +template <class T> using A4 = A<((T::num))>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<((T::num))>' vs 'A<(T::num)>') + +template <class T> using A5 = A<T::num, 1>; +template <class T> using A5 = A<T::num>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<[...], (default) 0>' vs 'A<[...], 1>') + +template <class T> using A6 = A<T::num + 5, 1>; +template <class T> using A6 = A<T::num + 5>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<[...], (default) 0>' vs 'A<[...], 1>') + +template <class T> using A7 = A<T::num, 1>; +template <class T> using A7 = A<(T::num)>; +// CHECK-ELIDE-NOTREE: type alias template redefinition with different types ('A<(T::num), (default) 0>' vs 'A<T::num, 1>') +} + // CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated. // CHECK-ELIDE-TREE: {{[0-9]*}} errors generated. |