gcc/testsuite/g++.dg/dfp/pr122834-2.C
raw| 1 | // PR c++/122834 |
| 2 | // { dg-do compile { target { c++11 && float16 } } } |
| 3 | // { dg-options "" } |
| 4 | // { dg-add-options float16 } |
| 5 | |
| 6 | typedef decltype (0.0DL) A; |
| 7 | typedef _Float16 B; |
| 8 | void bar (A); |
| 9 | |
| 10 | void |
| 11 | foo (B x) |
| 12 | { |
| 13 | bar (x); |
| 14 | } |
| 15 | |
| 16 | auto a = 0.0DL + 1.0F16; |
| 17 | auto b = 1.0F16 + 0.0DL; |
| 18 | static_assert (__is_same_as (decltype (0.0DL + 1.0F16), decltype (0.0DL))); |
| 19 | static_assert (__is_same_as (decltype (1.0F16 + 0.0DL), decltype (0.0DL))); |