c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / pr87633.C
blob86926cd8bf837fc144d2a7f2eee3340c1b03046f
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
4 class a {
5 public:
6   double b() const;
7 };
8 class c {
9 public:
10   int m_fn2() const;
12 double a::b() const {
13   return 0 == 0 ? reinterpret_cast<const c *>(this)->m_fn2() : 0;
15 bool d;
16 void e() {
17   a f;
18   double g = f.b();
19   /* { dg-final { scan-tree-dump-not "unord" "optimized" } } */
20   d = __builtin_isnan(g);