comparison gcc/testsuite/g++.dg/cpp1z/static_assert-nomsg.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 // { dg-options "-std=c++17" } 1 // { dg-do compile { target c++17 } }
2 2
3 template<typename T> 3 template<typename T>
4 struct is_float 4 struct is_float
5 { 5 {
6 static constexpr bool value = false; 6 static constexpr bool value = false;
11 { 11 {
12 static constexpr bool value = true; 12 static constexpr bool value = true;
13 }; 13 };
14 14
15 template<typename T> 15 template<typename T>
16 T 16 void
17 float_thing(T __x) 17 float_thing(T __x)
18 { 18 {
19 static_assert(is_float<T>::value, ""); // { dg-error "static assertion failed" } 19 static_assert(is_float<T>::value, ""); // { dg-error "static assertion failed" }
20 static_assert(is_float<T>::value); // { dg-error "static assertion failed" } 20 static_assert(is_float<T>::value); // { dg-error "static assertion failed" }
21 } 21 }