[clang] [Clang] Fix null pointer dereference in enum debug info generation (PR #97105)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 10:58:11 PDT 2024


================
@@ -98,3 +98,6 @@ enum E8 { A8 = -128, B8 = 127 } x8;
 // CHECK-NOT: DIFlagEnumClass
 // CHECK: !DIEnumerator(name: "A8", value: -128)
 
+// Forward declaration of an enum class.
+enum class Color : int;
+// CHECK-NOT: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Color"
----------------
dwblaikie wrote:

Have you run this test? Because an unused enum like this usually isn't/shouldn't be emitted into the output... - note all the other enums have a variable declared of their type (the trailing "} xN;")

https://github.com/llvm/llvm-project/pull/97105


More information about the cfe-commits mailing list