зеркало из https://github.com/microsoft/clang-1.git
Check for non-POD vararg argument type after default argument promotion, not
before, so we don't incorrectly think arguments of function type are non-POD. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159290 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
12d2cc71bf
Коммит
83ea530f9d
|
@ -679,7 +679,7 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT,
|
|||
|
||||
// Diagnostics regarding non-POD argument types are
|
||||
// emitted along with format string checking in Sema::CheckFunctionCall().
|
||||
if (isValidVarArgType(Ty) == VAK_Invalid) {
|
||||
if (isValidVarArgType(E->getType()) == VAK_Invalid) {
|
||||
// Turn this into a trap.
|
||||
CXXScopeSpec SS;
|
||||
SourceLocation TemplateKWLoc;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -emit-llvm -o - %s
|
||||
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
|
||||
// PR6433 - Don't crash on va_arg(typedef).
|
||||
|
@ -9,3 +9,9 @@ void focus_changed_cb () {
|
|||
mfloat = __builtin_va_arg((pa), gdouble);
|
||||
}
|
||||
|
||||
void vararg(int, ...);
|
||||
void function_as_vararg() {
|
||||
// CHECK: define {{.*}}function_as_vararg
|
||||
// CHECK-NOT: llvm.trap
|
||||
vararg(0, focus_changed_cb);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче