[PATCH] D66192: [analyzer] Don't delete TaintConfig copy constructor

Alex Langford via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 17:58:40 PDT 2019


xiaobai created this revision.
xiaobai added reviewers: compnerd, Szelethus, boga95, NoQ, alexshap.
Herald added subscribers: Charusso, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: clang.

Explicitly deleting the copy constructor makes compiling the function 
`ento::registerGenericTaintChecker` difficult with some compilers. When we
construct an `llvm::Optional<TaintConfig>`, the optional is constructed with a
const TaintConfig reference which it then uses to invoke the deleted TaintConfig
copy constructor.

I've observered this failing with clang 3.8 on Ubuntu 16.04.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66192

Files:
  clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp


Index: clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
+++ clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
@@ -71,9 +71,9 @@
     std::vector<NameArgsPair> Sinks;
 
     TaintConfiguration() = default;
-    TaintConfiguration(const TaintConfiguration &) = delete;
+    TaintConfiguration(const TaintConfiguration &) = default;
     TaintConfiguration(TaintConfiguration &&) = default;
-    TaintConfiguration &operator=(const TaintConfiguration &) = delete;
+    TaintConfiguration &operator=(const TaintConfiguration &) = default;
     TaintConfiguration &operator=(TaintConfiguration &&) = default;
   };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66192.214998.patch
Type: text/x-patch
Size: 759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190814/6ca37079/attachment.bin>


More information about the cfe-commits mailing list