Enums without an explicit, fixed, underlying type are implicitly given a
fixed 'int' type for ABI compatibility with MSVC. However, we can
enforce the standard-mandated rules on these types as-if we didn't know
this fact if the tag is not part of a definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249667
91177308-0d34-0410-b5e6-
96231b3b80d8
EnumUnderlying = Context.IntTy.getTypePtr();
} else if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {
- // Microsoft enums are always of int type.
- EnumUnderlying = Context.IntTy.getTypePtr();
+ if (getLangOpts().MSVCCompat || TUK == TUK_Definition) {
+ // Microsoft enums are always of int type.
+ EnumUnderlying = Context.IntTy.getTypePtr();
+ }
}
}
-// RUN: %clang_cc1 -triple %itanium_abi_triple -Wno-return-type -Wno-unused-value -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-return-type -Wno-unused-value -emit-llvm %s -o - | FileCheck %s
// CHECK: @i = common global [[INT:i[0-9]+]] 0
volatile int i, j, k;
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -Wc++14-compat %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify -std=c++11 -Wc++14-compat %s
// Need std::initializer_list
namespace std {
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only %s -verify
+// RUN: %clang_cc1 -fsyntax-only %s -verify
// PR5692
enum x; // expected-note {{forward declaration}}
-// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -fsyntax-only -verify %s
const int AA = 5;