[clang] fbbf1be - [HLSL][NFC] Fix static analyzer concerns (#120090)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 17 05:37:52 PST 2024


Author: Mariya Podchishchaeva
Date: 2024-12-17T14:37:48+01:00
New Revision: fbbf1bed746c335b970aee7bd135676e534ffa05

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

LOG: [HLSL][NFC] Fix static analyzer concerns (#120090)

Class BuiltinTypeMethodBuilder has a user-defined destructor so likely
compiler generated special functions may behave incorrectly. Delete
explicitly copy constructor and copy assignment operator to avoid
potential errors.

Added: 
    

Modified: 
    clang/lib/Sema/HLSLExternalSemaSource.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp
index 09fced1115687b..f3362fb619afc1 100644
--- a/clang/lib/Sema/HLSLExternalSemaSource.cpp
+++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp
@@ -559,6 +559,10 @@ struct BuiltinTypeMethodBuilder {
 public:
   ~BuiltinTypeMethodBuilder() { finalizeMethod(); }
 
+  BuiltinTypeMethodBuilder(const BuiltinTypeMethodBuilder &Other) = delete;
+  BuiltinTypeMethodBuilder &
+  operator=(const BuiltinTypeMethodBuilder &Other) = delete;
+
   Expr *getResourceHandleExpr() {
     // The first statement added to a method or access to 'this' creates the
     // declaration.


        


More information about the cfe-commits mailing list