[clang] 11fe931 - [AST] Initialized AutoTypeLocInfo::FoundDecl

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Thu May 18 01:21:44 PDT 2023


Author: Vitaly Buka
Date: 2023-05-18T01:21:29-07:00
New Revision: 11fe9310b9146ee7dfd7cf01662e8fc0a7cd508c

URL: https://github.com/llvm/llvm-project/commit/11fe9310b9146ee7dfd7cf01662e8fc0a7cd508c
DIFF: https://github.com/llvm/llvm-project/commit/11fe9310b9146ee7dfd7cf01662e8fc0a7cd508c.diff

LOG: [AST] Initialized AutoTypeLocInfo::FoundDecl

Msan complains if getFoundDecl called before it's set.
This looks like data class, so I see no reason to keep
the single field uninitialized.

Added: 
    

Modified: 
    clang/include/clang/AST/TypeLoc.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h
index 72ed3cb752e0f..8bf64dc6158c3 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -2102,7 +2102,7 @@ struct AutoTypeLocInfo : TypeSpecLocInfo {
   NestedNameSpecifierLoc NestedNameSpec;
   SourceLocation TemplateKWLoc;
   SourceLocation ConceptNameLoc;
-  NamedDecl *FoundDecl;
+  NamedDecl *FoundDecl = nullptr;
   SourceLocation LAngleLoc;
   SourceLocation RAngleLoc;
 


        


More information about the cfe-commits mailing list