diff options
Diffstat (limited to 'clang/test/SemaCXX/overloaded-operator.cpp')
| -rw-r--r-- | clang/test/SemaCXX/overloaded-operator.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/overloaded-operator.cpp b/clang/test/SemaCXX/overloaded-operator.cpp index 52d0bff3884..dff9350cc98 100644 --- a/clang/test/SemaCXX/overloaded-operator.cpp +++ b/clang/test/SemaCXX/overloaded-operator.cpp @@ -550,3 +550,38 @@ namespace PR27027 { bool test_global_1 = +a_global; // expected-error {{overload resolution selected deleted operator '+'}} bool test_global_2 = a_global + a_global; // expected-error {{overload resolution selected deleted operator '+'}} } + +namespace LateADLInNonDependentExpressions { + struct A {}; + struct B : A {}; + int &operator+(A, A); + int &operator!(A); + int &operator+=(A, A); + int &operator<<(A, A); + int &operator++(A); + int &operator++(A, int); + int &operator->*(A, A); + + template<typename T> void f() { + // An instantiation-dependent value of type B. + // These are all non-dependent operator calls of type int&. +#define idB ((void()), B()) + int &a = idB + idB, + &b = !idB, + &c = idB += idB, + &d = idB << idB, + &e = ++idB, + &f = idB++, + &g = idB ->* idB; + } + + // These should not be found by ADL in the template instantiation. + float &operator+(B, B); + float &operator!(B); + float &operator+=(B, B); + float &operator<<(B, B); + float &operator++(B); + float &operator++(B, int); + float &operator->*(B, B); + template void f<int>(); +} |

