shafik added inline comments.

================
Comment at: clang/test/Analysis/cfg.cpp:227
+enum MyEnum : int { A, B, C };
 static const enum MyEnum D = (enum MyEnum) 32;
 
----------------
This is undefined behavior unless the enum has a fixed type, using `: int` 
above does that.


================
Comment at: clang/test/SemaCXX/enum-scoped.cpp:330
 namespace PR35586 {
-  enum C { R, G, B };
+  enum C { R=-1, G, B };
   enum B { F = (enum C) -1, T}; // this should compile cleanly, it used to 
assert.
----------------
@erichkeane not sure if this fix for the test maintains the original intent of 
the test or not.


================
Comment at: 
cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp:28
 void ttp_user() { }
-enum Enumeration { Enumerator1, Enumerator2, Enumerator3 = 1 };
+enum Enumeration : int { Enumerator1, Enumerator2, Enumerator3 = 1 };
 enum class EnumerationClass { Enumerator1, Enumerator2, Enumerator3 = 1 };
----------------
These enums are used with undefined behavior later on by casting values outside 
of the range and using them as template arguments. Given them a fixed underling 
type removes the UB.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130058/new/

https://reviews.llvm.org/D130058

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to