gcc/testsuite/g++.dg/cpp0x/constexpr-46336.C
raw| 1 | // PR c++/46336 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | extern "C" { |
| 5 | enum A { }; |
| 6 | inline constexpr A |
| 7 | f(A a, A b) // { dg-message "previous declaration" } |
| 8 | { return A(static_cast<int>(a) & static_cast<int>(b)); } |
| 9 | enum B { }; |
| 10 | inline constexpr B |
| 11 | f(B a, B b) // { dg-error "C function" } |
| 12 | { return B(static_cast<int>(a) & static_cast<int>(b)); } |
| 13 | } |
| 14 |