mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 03:46:43 +00:00
No longer assuming the number of prototype arguments is always less than the number of formal parameters for a variadic function call.
llvm-svn: 160570
This commit is contained in:
parent
66a00c765f
commit
9bca21ed25
@ -10998,7 +10998,7 @@ Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Obj,
|
||||
// If this is a variadic call, handle args passed through "...".
|
||||
if (Proto->isVariadic()) {
|
||||
// Promote the arguments (C99 6.5.2.2p7).
|
||||
for (unsigned i = NumArgsInProto; i != NumArgs; i++) {
|
||||
for (unsigned i = NumArgsInProto; i < NumArgs; i++) {
|
||||
ExprResult Arg = DefaultVariadicArgumentPromotion(Args[i], VariadicMethod, 0);
|
||||
IsError |= Arg.isInvalid();
|
||||
TheCall->setArg(i + 1, Arg.take());
|
||||
|
@ -27,3 +27,8 @@ void test2() {
|
||||
x->operator float(); // expected-error{{no member named 'operator float'}}
|
||||
x->operator; // expected-error{{expected a type}}
|
||||
}
|
||||
|
||||
namespace pr13157 {
|
||||
class A { public: void operator()(int x, int y = 2, ...) {} };
|
||||
void f() { A()(1); }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user