Fix type in the changelog entry,
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr62015.C
blob950b46e759b3a6c439388d29937c54bd555af422
1 /* { dg-do run } */
2 /* { dg-options "-O3 -std=c++11"  } */
5 extern "C" int printf(const char *fmt, ...);
6 extern "C" void abort(void);
8 struct Side {
9     enum _Value { Left, Right, Invalid };
11     constexpr Side() : _value(Invalid) {}
12     constexpr Side(_Value value) : _value(value) {}
13     operator _Value() const { return (_Value)_value; }
15   private:
16     char _value;
19 struct A {
20     void init();
21     void adjust(Side side, bool final);
22     void move(Side side);
25 void A::init()
27     adjust(Side::Invalid, false);
30 static void __attribute__((noinline))
31 check (int v, int final)
33     if (v != 0)
34       abort();
38 __attribute__((noinline))
39 void A::adjust(Side side, bool final)
41   check ((int)side, final);
44 void A::move(Side side)
46     adjust(side, false);
47     adjust(side, true);
50 int main()
52     A t;
53     t.move(Side::Left);
54     return 0;