diff options
author | Anders Carlsson <andersca@mac.com> | 2009-03-15 18:44:04 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-03-15 18:44:04 +0000 |
commit | 94b15fbc3a10cdfb1639528a8a773b66a1e7cd9e (patch) | |
tree | 3a4a1934846d3c0270d5cd87b89891a47feb9396 /test/SemaCXX/static-assert.cpp | |
parent | a135fb43eb94524a6529768596a4533eed9aa70d (diff) |
Handle static_asserts when instantiating structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/static-assert.cpp')
-rw-r--r-- | test/SemaCXX/static-assert.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/SemaCXX/static-assert.cpp b/test/SemaCXX/static-assert.cpp index 94ffff86cd..7e1ee467ad 100644 --- a/test/SemaCXX/static-assert.cpp +++ b/test/SemaCXX/static-assert.cpp @@ -15,10 +15,16 @@ class C { }; template<int N> struct T { - static_assert(N == 2, "N is not 2!"); + static_assert(N == 2, "N is not 2!"); // expected-error {{static_assert failed "N is not 2!"}} }; +T<1> t1; // expected-note {{in instantiation of template class 'struct T<1>' requested here}} +T<2> t2; + template<typename T> struct S { - static_assert(sizeof(T) > sizeof(char), "Type not big enough!"); + static_assert(sizeof(T) > sizeof(char), "Type not big enough!"); // expected-error {{static_assert failed "Type not big enough!"}} }; +S<char> s1; // expected-note {{in instantiation of template class 'struct S<char>' requested here}} +S<int> s2; + |