shafik added inline comments.
================ Comment at: clang/lib/AST/ExprConstant.cpp:13532 - if (DestType->isEnumeralType()) { + if (Info.Ctx.getLangOpts().CPlusPlus && DestType->isEnumeralType()) { const EnumType *ET = dyn_cast<EnumType>(DestType.getCanonicalType()); ---------------- Changing this to a warning meaning it applied in more cases, so I need to explicitly restrict this to C++ contexts. ================ Comment at: clang/test/SemaCXX/MicrosoftCompatibility.cpp:242 ENUM *var = 0; -ENUM var2 = (ENUM)3; +ENUM var2 = (ENUM)0; enum ENUM1* var3 = 0;// expected-warning {{forward references to 'enum' types are a Microsoft extension}} ---------------- This is undefined behavior, using `0` avoids the diagnostic and I believe still sticks to the intent of the test. Same below. ================ Comment at: clang/test/SemaCXX/compare.cpp:432 - // FIXME: We should warn about constructing this out-of-range numeration value. - const E invalid = (E)-1; - // ... but we should not warn about comparing against it. ---------------- This is UB and I don't think this applies anymore. ================ Comment at: clang/test/SemaCXX/constant-expression-cxx11.cpp:2422 + constexpr E1 x2 = static_cast<E1>(8); + // expected-error@-1 {{integer value 8 is outside the valid range of values [-8, 7] for this enumeration type}} ---------------- I kept this on the next line since when we turn this back into an error we will have two diagnostics again. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131307/new/ https://reviews.llvm.org/D131307 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits