Move llvm::cl::opt's conversion function into the base classes that
authorDouglas Gregor <dgregor@apple.com>
Thu, 5 Nov 2009 18:30:50 +0000 (18:30 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 5 Nov 2009 18:30:50 +0000 (18:30 +0000)
actually need that conversion function. Silences a Clang++ warning.

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

include/llvm/Support/CommandLine.h

index 60be345726a209adac93a905dcda0041d4a91cf3..2e65fdd79a143dfa6c29b44b69527f33f3a7bbec 100644 (file)
@@ -781,6 +781,8 @@ public:
 
   DataType &getValue() { check(); return *Location; }
   const DataType &getValue() const { check(); return *Location; }
+  
+  operator DataType() const { return this->getValue(); }
 };
 
 
@@ -816,6 +818,8 @@ public:
   DataType &getValue() { return Value; }
   DataType getValue() const { return Value; }
 
+  operator DataType() const { return getValue(); }
+
   // If the datatype is a pointer, support -> on it.
   DataType operator->() const { return Value; }
 };
@@ -865,8 +869,6 @@ public:
 
   ParserClass &getParser() { return Parser; }
 
-  operator DataType() const { return this->getValue(); }
-
   template<class T>
   DataType &operator=(const T &Val) {
     this->setValue(Val);