diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2009-12-01 11:08:04 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2009-12-01 11:08:04 +0000 |
commit | 4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa (patch) | |
tree | 867cbbe32a66fd7d62dd9ce9df23a23fefdb8290 /test/SemaTemplate/instantiate-static-var.cpp | |
parent | 6df2408694f81a03eb8b0e3b013272042233c061 (diff) | |
download | FreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.zip FreeBSD-src-4b08eb6308ca90a6c08e2fc79d100821b1b1f6aa.tar.gz |
Update clang to r90226.
Diffstat (limited to 'test/SemaTemplate/instantiate-static-var.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-static-var.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-static-var.cpp b/test/SemaTemplate/instantiate-static-var.cpp index 96fa34c..452fccf 100644 --- a/test/SemaTemplate/instantiate-static-var.cpp +++ b/test/SemaTemplate/instantiate-static-var.cpp @@ -1,5 +1,4 @@ // RUN: clang-cc -fsyntax-only -verify %s - template<typename T, T Divisor> class X { public: @@ -38,3 +37,38 @@ void test() { DefCon &DC = Z<DefCon>::value; NoDefCon &NDC = Z<NoDefCon>::value; // expected-note{{instantiation}} } + +// PR5609 +struct X1 { + ~X1(); // The errors won't be triggered without this dtor. +}; + +template <typename T> +struct Y1 { + static char Helper(T); + static const int value = sizeof(Helper(T())); +}; + +struct X2 { + virtual ~X2(); +}; + +namespace std { + class type_info { }; +} + +template <typename T> +struct Y2 { + static T &Helper(); + static const int value = sizeof(typeid(Helper())); +}; + +template <int> +struct Z1 {}; + +void Test() { + Z1<Y1<X1>::value> x; + int y[Y1<X1>::value]; + Z1<Y2<X2>::value> x2; + int y2[Y2<X2>::value]; +} |