]> granicus.if.org Git - llvm/commitdiff
[FileCheck] Make NumericVariable ctor explicit
authorThomas Preud'homme <thomasp@graphcore.ai>
Mon, 2 Sep 2019 14:04:05 +0000 (14:04 +0000)
committerThomas Preud'homme <thomasp@graphcore.ai>
Mon, 2 Sep 2019 14:04:05 +0000 (14:04 +0000)
Summary:
Make FileCheckNumericVariable constructor explicit to avoid implicit
conversions from StringRef.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66640

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370664 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileCheck.h

index 149666157a6cfb86ce90ee3dd3fe1c5760639f47..34301f92bcb5c9fdf3e1044653ad9f71fafc43cf 100644 (file)
@@ -109,8 +109,8 @@ private:
 public:
   /// Constructor for a variable \p Name defined at line \p DefLineNumber or
   /// defined before input is parsed if \p DefLineNumber is None.
-  FileCheckNumericVariable(StringRef Name,
-                           Optional<size_t> DefLineNumber = None)
+  explicit FileCheckNumericVariable(StringRef Name,
+                                    Optional<size_t> DefLineNumber = None)
       : Name(Name), DefLineNumber(DefLineNumber) {}
 
   /// \returns name of this numeric variable.