When adding ADL candidates for overloaded

post-increment/post-decrement operators, be sure to consider both
arguments. Fixes PR6237.

llvm-svn: 95361
This commit is contained in:
Douglas Gregor 2010-02-05 05:15:43 +00:00
parent 7fcd8acbf8
commit 6ec89d4953
2 changed files with 13 additions and 1 deletions

View File

@ -5528,7 +5528,7 @@ Sema::CreateOverloadedUnaryOp(SourceLocation OpLoc, unsigned OpcIn,
// Add candidates from ADL.
AddArgumentDependentLookupCandidates(OpName, /*Operator*/ true,
Args, 1,
Args, NumArgs,
/*ExplicitTemplateArgs*/ 0,
CandidateSet);

View File

@ -87,6 +87,18 @@ void add(const T &x) {
(void)(x + x);
}
namespace PR6237 {
template <typename T>
void f(T t) {
t++;
}
struct B { };
B operator++(B &, int);
template void f(B);
}
struct Addable {
Addable operator+(const Addable&) const;
};