Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / g++.dg / conversion / bitfield8.C
blobdbc62fade5ddeff259f8cba2d87d25148628d791
1 // PR c++/35056
2 // { dg-do compile }
3 // { dg-options "-O2" }
5 enum EBorderStyle { bla = 1 };
6 inline bool compare_ref(const unsigned int &t, const EBorderStyle &u)
7 { return t == u; }
8 inline bool compare_val(const unsigned int t, const EBorderStyle u)
9 { return t == u; }
10 struct S {
11   unsigned m_style : 4;
13 void call_ref (S *s, EBorderStyle v)
14 { if (!compare_ref(s->m_style, v)) s->m_style = v; }
15 void call_val (S *s, EBorderStyle v)
16 { if (!compare_val(s->m_style, v)) s->m_style = v; }