-// { dg-do run { target c++14 } }
+// { dg-do compile { target c++14 } }
template<int A, int B>
struct S1
int main ()
{
- int v = var<S1<199, 23>>/2;
- return !(
- var<S1<11, 100>> == v
- && var<S1<50, 120>> == var<S1<150, var<S1<10, 10>>>>
- && var<S1<53, 23>> != 222
- );
+ static_assert(var<S1<11, 100>> == var<S1<199, 23>>/2
+ && var<S1<50, 120>> == var<S1<150, var<S1<10, 10>>>>
+ && var<S1<53, 23>> != 222, "");
}
-// { dg-do run { target c++14 } }
+// { dg-do compile { target c++14 } }
template<typename T>
constexpr int var = sizeof (T);
int main ()
{
- return !(
- var<int> + var<char> == S1<int>::a<char>
- );
+ static_assert(var<int> + var<char> == S1<int>::a<char>, "");
}
-// { dg-do run { target c++14 } }
+// { dg-do compile { target c++14 } }
template<typename T>
constexpr int var = sizeof (T);
int main ()
{
- return !(
- var<int> == 100000
- && var<char> == sizeof(char)
- );
+ static_assert(var<int> == 100000 && var<char> == sizeof(char), "");
}
-// { dg-do run { target c++14 } }
+// { dg-do compile { target c++14 } }
template<int A, int B>
struct S1
int main ()
{
- return !(
- var2<S1, 40> == 120
- );
+ static_assert(var2<S1, 40> == 120, "");
}