| 1 |
// Testcase for mangling of expressions involving operator names. |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-fabi-version=10 -fabi-compat-version=10" } |
| 4 |
// { dg-final { scan-assembler "_Z1fI1AEDTclonplfp_fp_EET_" } } |
| 5 |
// { dg-final { scan-assembler "_Z1gI1AEDTclonplIT_Efp_fp_EES1_" } } |
| 6 |
// { dg-final { scan-assembler "_Z1hI1AEDTcldtfp_miEET_" } } |
| 7 |
// { dg-final { scan-assembler "_Z1iI1AEDTcldtfp_srT_miEES1_" } } |
| 8 |
// { dg-final { scan-assembler "_Z1jI1AEDTcldtfp_cvPT_EES1_" } } |
| 9 |
|
| 10 |
struct A { |
| 11 |
void operator-(); |
| 12 |
template <class T> |
| 13 |
operator T(); |
| 14 |
}; |
| 15 |
template <class T> |
| 16 |
T operator+(T,T); |
| 17 |
|
| 18 |
template <class T> |
| 19 |
auto f (T t) -> decltype(operator+(t,t)); |
| 20 |
template <class T> |
| 21 |
auto g (T t) -> decltype(operator+<T>(t,t)); |
| 22 |
template <class T> |
| 23 |
auto h (T t) -> decltype(t.operator-()); |
| 24 |
template <class T> |
| 25 |
auto i (T t) -> decltype(t.T::operator-()); |
| 26 |
template <class T> |
| 27 |
auto j (T t) -> decltype(t.operator T*()); |
| 28 |
|
| 29 |
int main() |
| 30 |
{ |
| 31 |
f(A()); |
| 32 |
g(A()); |
| 33 |
h(A()); |
| 34 |
i(A()); |
| 35 |
j(A()); |
| 36 |
} |