[clang] [analyzer][CTU] Macro expansions for imported translation units (PR #176126)

Balázs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 07:09:32 PST 2026


================
@@ -169,15 +170,17 @@ class Token;
     /// The definition of this macro or the name of the macro if it is
     /// a builtin macro.
     llvm::PointerUnion<IdentifierInfo *, MacroDefinitionRecord *> NameOrDef;
+    std::optional<std::string> Expanded;
 
   public:
     MacroExpansion(IdentifierInfo *BuiltinName, SourceRange Range)
-        : PreprocessedEntity(MacroExpansionKind, Range),
-          NameOrDef(BuiltinName) {}
+        : PreprocessedEntity(MacroExpansionKind, Range), NameOrDef(BuiltinName),
+          Expanded(std::nullopt) {}
----------------
steakhal wrote:

I suppose we don't need to change these lines because by default a std::optional member is defines as nullopt.

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


More information about the cfe-commits mailing list