]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/Wunused-value1.C
Regenerate riscv.opt.urls and i386.opt.urls
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp0x / Wunused-value1.C
CommitLineData
7f3db013
MP
1// PR c++/90881
2// { dg-do compile { target c++11 } }
3// { dg-options "-Wall" }
4
5namespace std {
6 struct true_type { static const bool value = true; };
7 struct false_type { static const bool value = false; };
8}
9
10template <typename T, typename = void> struct status : std::false_type{};
11
12template <typename T> struct status<T, decltype(T::member, void())> : std::true_type {}; // { dg-bogus "left operand of comma operator has no effect" }
13
14struct s1{int member;};
15struct s2{int _member;};
16
17int main(){
18 static_assert(status<s1>::value, "has member");
19 static_assert(!status<s2>::value, "has no member");
20}