diff options
Diffstat (limited to 'include/llvm/Support/CommandLine.h')
-rw-r--r-- | include/llvm/Support/CommandLine.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index ca32f75..2e65fdd 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -495,7 +495,8 @@ public: //-------------------------------------------------- // basic_parser - Super class of parsers to provide boilerplate code // -struct basic_parser_impl { // non-template implementation of basic_parser<t> +class basic_parser_impl { // non-template implementation of basic_parser<t> +public: virtual ~basic_parser_impl() {} enum ValueExpected getValueExpectedFlagDefault() const { @@ -525,7 +526,8 @@ struct basic_parser_impl { // non-template implementation of basic_parser<t> // a typedef for the provided data type. // template<class DataType> -struct basic_parser : public basic_parser_impl { +class basic_parser : public basic_parser_impl { +public: typedef DataType parser_data_type; }; @@ -779,6 +781,8 @@ public: DataType &getValue() { check(); return *Location; } const DataType &getValue() const { check(); return *Location; } + + operator DataType() const { return this->getValue(); } }; @@ -814,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; } }; @@ -863,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); |