forked from OSchip/llvm-project
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:
parent
7fcd8acbf8
commit
6ec89d4953
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue