зеркало из https://github.com/microsoft/clang-1.git
Check for placeholder expressions before promoting an argument passed
through an ellipsis. Fixes <rdar://problem/9623945>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133219 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
7a883e3e17
Коммит
8d5e18c69e
|
@ -439,7 +439,11 @@ ExprResult Sema::DefaultArgumentPromotion(Expr *E) {
|
|||
/// interfaces passed by value.
|
||||
ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
|
||||
FunctionDecl *FDecl) {
|
||||
ExprResult ExprRes = DefaultArgumentPromotion(E);
|
||||
ExprResult ExprRes = CheckPlaceholderExpr(E);
|
||||
if (ExprRes.isInvalid())
|
||||
return ExprError();
|
||||
|
||||
ExprRes = DefaultArgumentPromotion(E);
|
||||
if (ExprRes.isInvalid())
|
||||
return ExprError();
|
||||
E = ExprRes.take();
|
||||
|
|
|
@ -12,3 +12,19 @@ void test(bool b) {
|
|||
(void)(b? ovl<float> : &ovl); // expected-error{{cannot resolve overloaded function 'ovl' from context}}
|
||||
(void)(b? ovl<float> : ovl<float>);
|
||||
}
|
||||
|
||||
namespace rdar9623945 {
|
||||
void f(...) {
|
||||
}
|
||||
|
||||
class X {
|
||||
public:
|
||||
const char* text(void);
|
||||
void g(void) {
|
||||
f(text());
|
||||
f(text); // expected-error{{a bound member function may only be called}}
|
||||
f(text());
|
||||
f(text); // expected-error{{a bound member function may only be called}}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче