1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // Ensure we undo the rewrite from `a++` to a binary `a ++ 0` before profiling.
5 // Increment / decrement as UnaryOperator.
6 template<typename T
> auto inc(T
&a
) -> decltype(a
++) {} // expected-note {{previous}}
7 template<typename T
> auto dec(T
&a
) -> decltype(a
--) {} // expected-note {{previous}}
10 void operator++(X
&, int);
11 void operator--(X
&, int);
12 // Increment / decrement as CXXOverloadedCallExpr. These are redefinitions.
13 template<typename T
> auto inc(T
&a
) -> decltype(a
++) {} // expected-error {{redefinition}} expected-note {{candidate}}
14 template<typename T
> auto dec(T
&a
) -> decltype(a
--) {} // expected-error {{redefinition}} expected-note {{candidate}}
16 // These are not ambiguous calls.
18 // FIXME: Don't produce these follow-on errors.
19 inc(x
); // expected-error {{no match}}
20 dec(x
); // expected-error {{no match}}