]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/static_assert12.C
gcc/ada/ChangeLog:
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp0x / static_assert12.C
CommitLineData
1f6b3916 1// { dg-do compile }
2// { dg-options "-std=gnu++11 -pedantic" }
3
4template<typename T>
5 struct is_float
6 {
7 static constexpr bool value = false;
8 };
9
10template<>
11 struct is_float<float>
12 {
13 static constexpr bool value = true;
14 };
15
16template<typename T>
144be263 17 void
1f6b3916 18 float_thing(T __x)
19 {
20 static_assert(is_float<T>::value, ""); // { dg-error "static assertion failed" }
21 static_assert(is_float<T>::value); // { dg-error "static assertion failed" }
22 }
23
24int
25main()
26{
27 float_thing(1);
28}
29
85b9be9b 30// { dg-warning "'static_assert' without a message only available with " "" { target *-*-* } 21 }