r281612 - Reverting r281609; it caused some build bots to break.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 07:12:34 PDT 2016


Author: aaronballman
Date: Thu Sep 15 09:12:33 2016
New Revision: 281612

URL: http://llvm.org/viewvc/llvm-project?rev=281612&view=rev
Log:
Reverting r281609; it caused some build bots to break.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/20061/steps/test/logs/stdio

Modified:
    cfe/trunk/lib/Sema/SemaChecking.cpp
    cfe/trunk/test/Sema/varargs.c

Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=281612&r1=281611&r2=281612&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Thu Sep 15 09:12:33 2016
@@ -3240,17 +3240,8 @@ bool Sema::SemaBuiltinVAStartImpl(CallEx
     Diag(TheCall->getArg(1)->getLocStart(),
          diag::warn_second_arg_of_va_start_not_last_named_param);
   else if (IsCRegister || Type->isReferenceType() ||
-           Type->isSpecificBuiltinType(BuiltinType::Float) || [=] {
-             // Promotable integers are UB, but enumerations need a bit of
-             // extra checking to see what their promotable type actually is.
-             if (!Type->isPromotableIntegerType())
-               return false;
-             if (!Type->isEnumeralType())
-               return true;
-             const EnumDecl *ED = Type->getAs<EnumType>()->getDecl();
-             return !(ED &&
-                      Context.typesAreCompatible(ED->getPromotionType(), Type));
-           }()) {
+           Type->isPromotableIntegerType() ||
+           Type->isSpecificBuiltinType(BuiltinType::Float)) {
     unsigned Reason = 0;
     if (Type->isReferenceType())  Reason = 1;
     else if (IsCRegister)         Reason = 2;

Modified: cfe/trunk/test/Sema/varargs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/varargs.c?rev=281612&r1=281611&r2=281612&view=diff
==============================================================================
--- cfe/trunk/test/Sema/varargs.c (original)
+++ cfe/trunk/test/Sema/varargs.c Thu Sep 15 09:12:33 2016
@@ -1,6 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -triple i386-pc-unknown
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 // RUN: %clang_cc1 -fsyntax-only -verify %s -triple x86_64-apple-darwin9
-// RUN: %clang_cc1 -fsyntax-only -fms-compatibility -DMS -verify %s
 
 void f1(int a)
 {
@@ -95,20 +94,3 @@ void f12(register int i, ...) {  // expe
   __builtin_va_start(ap, i); // expected-warning {{passing a parameter declared with the 'register' keyword to 'va_start' has undefined behavior}}
   __builtin_va_end(ap);
 }
-
-enum __attribute__((packed)) E1 {
-  one1
-};
-
-void f13(enum E1 e, ...) {
-  __builtin_va_list va;
-  __builtin_va_start(va, e);
-#ifndef MS
-  // In Microsoft compatibility mode, all enum types are int, but in
-  // non-ms-compatibility mode, this enumeration type will undergo default
-  // argument promotions.
-  // expected-note at -7 {{parameter of type 'enum E1' is declared here}}
-  // expected-warning at -6 {{passing an object that undergoes default argument promotion to 'va_start' has undefined behavior}}
-#endif
-  __builtin_va_end(va);
-}




More information about the cfe-commits mailing list