Replace a fake enum class with the real thing.

llvm-svn: 208943
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 71d1961..8514af2 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -101,15 +101,15 @@
   // an ambiguity if the first decl-specifier is
   // simple-type-specifier/typename-specifier followed by a '(', which may
   // indicate a function-style cast expression.
-  // isCXXDeclarationSpecifier will return TPResult::Ambiguous() only in such
+  // isCXXDeclarationSpecifier will return TPResult::Ambiguous only in such
   // a case.
 
   bool InvalidAsDeclaration = false;
-  TPResult TPR = isCXXDeclarationSpecifier(TPResult::False(),
+  TPResult TPR = isCXXDeclarationSpecifier(TPResult::False,
                                            &InvalidAsDeclaration);
-  if (TPR != TPResult::Ambiguous())
-    return TPR != TPResult::False(); // Returns true for TPResult::True() or
-                                     // TPResult::Error().
+  if (TPR != TPResult::Ambiguous)
+    return TPR != TPResult::False; // Returns true for TPResult::True or
+                                   // TPResult::Error.
 
   // FIXME: TryParseSimpleDeclaration doesn't look past the first initializer,
   // and so gets some cases wrong. We can't carry on if we've already seen
@@ -131,15 +131,15 @@
   PA.Revert();
 
   // In case of an error, let the declaration parsing code handle it.
-  if (TPR == TPResult::Error())
+  if (TPR == TPResult::Error)
     return true;
 
   // Declarations take precedence over expressions.
-  if (TPR == TPResult::Ambiguous())
-    TPR = TPResult::True();
+  if (TPR == TPResult::Ambiguous)
+    TPR = TPResult::True;
 
-  assert(TPR == TPResult::True() || TPR == TPResult::False());
-  return TPR == TPResult::True();
+  assert(TPR == TPResult::True || TPR == TPResult::False);
+  return TPR == TPResult::True;
 }
 
 /// Try to consume a token sequence that we've already identified as
@@ -157,10 +157,10 @@
   case tok::kw___underlying_type: {
     ConsumeToken();
     if (Tok.isNot(tok::l_paren))
-      return TPResult::Error();
+      return TPResult::Error;
     ConsumeParen();
     if (!SkipUntil(tok::r_paren))
-      return TPResult::Error();
+      return TPResult::Error;
     break;
   }
 
@@ -184,23 +184,23 @@
       if (Tok.is(tok::l_square)) {
         ConsumeBracket();
         if (!SkipUntil(tok::r_square))
-          return TPResult::Error();
+          return TPResult::Error;
       } else {
         ConsumeToken();
         if (Tok.isNot(tok::l_paren))
-          return TPResult::Error();
+          return TPResult::Error;
         ConsumeParen();
         if (!SkipUntil(tok::r_paren))
-          return TPResult::Error();
+          return TPResult::Error;
       }
     }
 
     if (TryAnnotateCXXScopeToken())
-      return TPResult::Error();
+      return TPResult::Error;
     if (Tok.is(tok::annot_cxxscope))
       ConsumeToken();
     if (Tok.isNot(tok::identifier) && Tok.isNot(tok::annot_template_id))
-      return TPResult::Error();
+      return TPResult::Error;
     ConsumeToken();
     break;
 
@@ -215,7 +215,7 @@
     break;
   }
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// simple-declaration:
@@ -227,29 +227,29 @@
 ///    attribute-specifier-seqopt type-specifier-seq declarator
 ///
 Parser::TPResult Parser::TryParseSimpleDeclaration(bool AllowForRangeDecl) {
-  if (TryConsumeDeclarationSpecifier() == TPResult::Error())
-    return TPResult::Error();
+  if (TryConsumeDeclarationSpecifier() == TPResult::Error)
+    return TPResult::Error;
 
   // Two decl-specifiers in a row conclusively disambiguate this as being a
   // simple-declaration. Don't bother calling isCXXDeclarationSpecifier in the
   // overwhelmingly common case that the next token is a '('.
   if (Tok.isNot(tok::l_paren)) {
     TPResult TPR = isCXXDeclarationSpecifier();
-    if (TPR == TPResult::Ambiguous())
-      return TPResult::True();
-    if (TPR == TPResult::True() || TPR == TPResult::Error())
+    if (TPR == TPResult::Ambiguous)
+      return TPResult::True;
+    if (TPR == TPResult::True || TPR == TPResult::Error)
       return TPR;
-    assert(TPR == TPResult::False());
+    assert(TPR == TPResult::False);
   }
 
   TPResult TPR = TryParseInitDeclaratorList();
-  if (TPR != TPResult::Ambiguous())
+  if (TPR != TPResult::Ambiguous)
     return TPR;
 
   if (Tok.isNot(tok::semi) && (!AllowForRangeDecl || Tok.isNot(tok::colon)))
-    return TPResult::False();
+    return TPResult::False;
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// Tentatively parse an init-declarator-list in order to disambiguate it from
@@ -283,23 +283,23 @@
   while (1) {
     // declarator
     TPResult TPR = TryParseDeclarator(false/*mayBeAbstract*/);
-    if (TPR != TPResult::Ambiguous())
+    if (TPR != TPResult::Ambiguous)
       return TPR;
 
     // [GNU] simple-asm-expr[opt] attributes[opt]
     if (Tok.is(tok::kw_asm) || Tok.is(tok::kw___attribute))
-      return TPResult::True();
+      return TPResult::True;
 
     // initializer[opt]
     if (Tok.is(tok::l_paren)) {
       // Parse through the parens.
       ConsumeParen();
       if (!SkipUntil(tok::r_paren, StopAtSemi))
-        return TPResult::Error();
+        return TPResult::Error;
     } else if (Tok.is(tok::l_brace)) {
       // A left-brace here is sufficient to disambiguate the parse; an
       // expression can never be followed directly by a braced-init-list.
-      return TPResult::True();
+      return TPResult::True;
     } else if (Tok.is(tok::equal) || isTokIdentifier_in()) {
       // MSVC and g++ won't examine the rest of declarators if '=' is
       // encountered; they just conclude that we have a declaration.
@@ -317,14 +317,14 @@
       // in any other context 'in' is invalid after a declaration and parser
       // issues the error regardless of outcome of this decision.
       // FIXME: Change if above assumption does not hold.
-      return TPResult::True();
+      return TPResult::True;
     }
 
     if (!TryConsumeToken(tok::comma))
       break;
   }
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// isCXXConditionDeclaration - Disambiguates between a declaration or an
@@ -342,9 +342,9 @@
 ///
 bool Parser::isCXXConditionDeclaration() {
   TPResult TPR = isCXXDeclarationSpecifier();
-  if (TPR != TPResult::Ambiguous())
-    return TPR != TPResult::False(); // Returns true for TPResult::True() or
-                                     // TPResult::Error().
+  if (TPR != TPResult::Ambiguous)
+    return TPR != TPResult::False; // Returns true for TPResult::True or
+                                   // TPResult::Error.
 
   // FIXME: Add statistics about the number of ambiguous statements encountered
   // and how they were resolved (number of declarations+number of expressions).
@@ -362,25 +362,25 @@
   TPR = TryParseDeclarator(false/*mayBeAbstract*/);
 
   // In case of an error, let the declaration parsing code handle it.
-  if (TPR == TPResult::Error())
-    TPR = TPResult::True();
+  if (TPR == TPResult::Error)
+    TPR = TPResult::True;
 
-  if (TPR == TPResult::Ambiguous()) {
+  if (TPR == TPResult::Ambiguous) {
     // '='
     // [GNU] simple-asm-expr[opt] attributes[opt]
     if (Tok.is(tok::equal)  ||
         Tok.is(tok::kw_asm) || Tok.is(tok::kw___attribute))
-      TPR = TPResult::True();
+      TPR = TPResult::True;
     else if (getLangOpts().CPlusPlus11 && Tok.is(tok::l_brace))
-      TPR = TPResult::True();
+      TPR = TPResult::True;
     else
-      TPR = TPResult::False();
+      TPR = TPResult::False;
   }
 
   PA.Revert();
 
-  assert(TPR == TPResult::True() || TPR == TPResult::False());
-  return TPR == TPResult::True();
+  assert(TPR == TPResult::True || TPR == TPResult::False);
+  return TPR == TPResult::True;
 }
 
   /// \brief Determine whether the next set of tokens contains a type-id.
@@ -412,9 +412,9 @@
   // in its syntactic context shall be considered a type-id.
 
   TPResult TPR = isCXXDeclarationSpecifier();
-  if (TPR != TPResult::Ambiguous())
-    return TPR != TPResult::False(); // Returns true for TPResult::True() or
-                                     // TPResult::Error().
+  if (TPR != TPResult::Ambiguous)
+    return TPR != TPResult::False; // Returns true for TPResult::True or
+                                     // TPResult::Error.
 
   // FIXME: Add statistics about the number of ambiguous statements encountered
   // and how they were resolved (number of declarations+number of expressions).
@@ -432,14 +432,14 @@
   TPR = TryParseDeclarator(true/*mayBeAbstract*/, false/*mayHaveIdentifier*/);
 
   // In case of an error, let the declaration parsing code handle it.
-  if (TPR == TPResult::Error())
-    TPR = TPResult::True();
+  if (TPR == TPResult::Error)
+    TPR = TPResult::True;
 
-  if (TPR == TPResult::Ambiguous()) {
+  if (TPR == TPResult::Ambiguous) {
     // We are supposed to be inside parens, so if after the abstract declarator
     // we encounter a ')' this is a type-id, otherwise it's an expression.
     if (Context == TypeIdInParens && Tok.is(tok::r_paren)) {
-      TPR = TPResult::True();
+      TPR = TPResult::True;
       isAmbiguous = true;
 
     // We are supposed to be inside a template argument, so if after
@@ -448,17 +448,17 @@
     } else if (Context == TypeIdAsTemplateArgument &&
                (Tok.is(tok::greater) || Tok.is(tok::comma) ||
                 (getLangOpts().CPlusPlus11 && Tok.is(tok::greatergreater)))) {
-      TPR = TPResult::True();
+      TPR = TPResult::True;
       isAmbiguous = true;
 
     } else
-      TPR = TPResult::False();
+      TPR = TPResult::False;
   }
 
   PA.Revert();
 
-  assert(TPR == TPResult::True() || TPR == TPResult::False());
-  return TPR == TPResult::True();
+  assert(TPR == TPResult::True || TPR == TPResult::False);
+  return TPR == TPResult::True;
 }
 
 /// \brief Returns true if this is a C++11 attribute-specifier. Per
@@ -624,7 +624,7 @@
   while (true) {
     if (Tok.is(tok::coloncolon) || Tok.is(tok::identifier))
       if (TryAnnotateCXXScopeToken(true))
-        return TPResult::Error();
+        return TPResult::Error;
 
     if (Tok.is(tok::star) || Tok.is(tok::amp) || Tok.is(tok::caret) ||
         Tok.is(tok::ampamp) ||
@@ -636,7 +636,7 @@
              Tok.is(tok::kw_restrict))
         ConsumeToken();
     } else {
-      return TPResult::True();
+      return TPResult::True;
     }
   }
 }
@@ -671,20 +671,20 @@
       ConsumeBracket();
       ConsumeBracket();
     }
-    return TPResult::True();
+    return TPResult::True;
 
 #define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemOnly) \
   case tok::Token:
 #define OVERLOADED_OPERATOR_MULTI(Name, Spelling, Unary, Binary, MemOnly)
 #include "clang/Basic/OperatorKinds.def"
     ConsumeToken();
-    return TPResult::True();
+    return TPResult::True;
 
   case tok::l_square:
     if (NextToken().is(tok::r_square)) {
       ConsumeBracket();
       ConsumeBracket();
-      return TPResult::True();
+      return TPResult::True;
     }
     break;
 
@@ -692,7 +692,7 @@
     if (NextToken().is(tok::r_paren)) {
       ConsumeParen();
       ConsumeParen();
-      return TPResult::True();
+      return TPResult::True;
     }
     break;
 
@@ -712,24 +712,24 @@
       if (Tok.is(tok::identifier))
         ConsumeToken();
       else
-        return TPResult::Error();
+        return TPResult::Error;
     }
-    return TPResult::True();
+    return TPResult::True;
   }
 
   // Maybe this is a conversion-function-id.
   bool AnyDeclSpecifiers = false;
   while (true) {
     TPResult TPR = isCXXDeclarationSpecifier();
-    if (TPR == TPResult::Error())
+    if (TPR == TPResult::Error)
       return TPR;
-    if (TPR == TPResult::False()) {
+    if (TPR == TPResult::False) {
       if (!AnyDeclSpecifiers)
-        return TPResult::Error();
+        return TPResult::Error;
       break;
     }
-    if (TryConsumeDeclarationSpecifier() == TPResult::Error())
-      return TPResult::Error();
+    if (TryConsumeDeclarationSpecifier() == TPResult::Error)
+      return TPResult::Error;
     AnyDeclSpecifiers = true;
   }
   return TryParsePtrOperatorSeq();
@@ -793,8 +793,8 @@
   // declarator:
   //   direct-declarator
   //   ptr-operator declarator
-  if (TryParsePtrOperatorSeq() == TPResult::Error())
-    return TPResult::Error();
+  if (TryParsePtrOperatorSeq() == TPResult::Error)
+    return TPResult::Error;
 
   // direct-declarator:
   // direct-abstract-declarator:
@@ -811,8 +811,8 @@
     else if (Tok.is(tok::identifier))
       TentativelyDeclaredIdentifiers.push_back(Tok.getIdentifierInfo());
     if (Tok.is(tok::kw_operator)) {
-      if (TryParseOperatorId() == TPResult::Error())
-        return TPResult::Error();
+      if (TryParseOperatorId() == TPResult::Error)
+        return TPResult::Error;
     } else
       ConsumeToken();
   } else if (Tok.is(tok::l_paren)) {
@@ -825,7 +825,7 @@
       // '(' parameter-declaration-clause ')' cv-qualifier-seq[opt]
       //        exception-specification[opt]
       TPResult TPR = TryParseFunctionDeclarator();
-      if (TPR != TPResult::Ambiguous())
+      if (TPR != TPResult::Ambiguous)
         return TPR;
     } else {
       // '(' declarator ')'
@@ -838,20 +838,20 @@
           Tok.is(tok::kw___fastcall) ||
           Tok.is(tok::kw___thiscall) ||
           Tok.is(tok::kw___unaligned))
-        return TPResult::True(); // attributes indicate declaration
+        return TPResult::True; // attributes indicate declaration
       TPResult TPR = TryParseDeclarator(mayBeAbstract, mayHaveIdentifier);
-      if (TPR != TPResult::Ambiguous())
+      if (TPR != TPResult::Ambiguous)
         return TPR;
       if (Tok.isNot(tok::r_paren))
-        return TPResult::False();
+        return TPResult::False;
       ConsumeParen();
     }
   } else if (!mayBeAbstract) {
-    return TPResult::False();
+    return TPResult::False;
   }
 
   while (1) {
-    TPResult TPR(TPResult::Ambiguous());
+    TPResult TPR(TPResult::Ambiguous);
 
     // abstract-declarator: ...
     if (Tok.is(tok::ellipsis))
@@ -877,11 +877,11 @@
       break;
     }
 
-    if (TPR != TPResult::Ambiguous())
+    if (TPR != TPResult::Ambiguous)
       return TPR;
   }
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 Parser::TPResult 
@@ -943,7 +943,7 @@
 #define TYPE_TRAIT(N,Spelling,K) \
   case tok::kw_##Spelling:
 #include "clang/Basic/TokenKinds.def"
-    return TPResult::True();
+    return TPResult::True;
       
   // Obviously starts a type-specifier-seq:
   case tok::kw_char:
@@ -989,13 +989,13 @@
   case tok::kw___pixel:
   case tok::kw__Atomic:
   case tok::kw___unknown_anytype:
-    return TPResult::False();
+    return TPResult::False;
 
   default:
     break;
   }
   
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 bool Parser::isTentativelyDeclared(IdentifierInfo *II) {
@@ -1004,16 +1004,16 @@
       != TentativelyDeclaredIdentifiers.end();
 }
 
-/// isCXXDeclarationSpecifier - Returns TPResult::True() if it is a declaration
-/// specifier, TPResult::False() if it is not, TPResult::Ambiguous() if it could
-/// be either a decl-specifier or a function-style cast, and TPResult::Error()
+/// isCXXDeclarationSpecifier - Returns TPResult::True if it is a declaration
+/// specifier, TPResult::False if it is not, TPResult::Ambiguous if it could
+/// be either a decl-specifier or a function-style cast, and TPResult::Error
 /// if a parsing error was found and reported.
 ///
 /// If HasMissingTypename is provided, a name with a dependent scope specifier
 /// will be treated as ambiguous if the 'typename' keyword is missing. If this
 /// happens, *HasMissingTypename will be set to 'true'. This will also be used
 /// as an indicator that undeclared identifiers (which will trigger a later
-/// parse error) should be treated as types. Returns TPResult::Ambiguous() in
+/// parse error) should be treated as types. Returns TPResult::Ambiguous in
 /// such cases.
 ///
 ///         decl-specifier:
@@ -1117,12 +1117,12 @@
     // Check for need to substitute AltiVec __vector keyword
     // for "vector" identifier.
     if (TryAltiVecVectorToken())
-      return TPResult::True();
+      return TPResult::True;
 
     const Token &Next = NextToken();
     // In 'foo bar', 'foo' is always a type name outside of Objective-C.
     if (!getLangOpts().ObjC1 && Next.is(tok::identifier))
-      return TPResult::True();
+      return TPResult::True;
 
     if (Next.isNot(tok::coloncolon) && Next.isNot(tok::less)) {
       // Determine whether this is a valid expression. If not, we will hit
@@ -1135,15 +1135,15 @@
       switch (TryAnnotateName(false /* no nested name specifier */,
                               &TypoCorrection)) {
       case ANK_Error:
-        return TPResult::Error();
+        return TPResult::Error;
       case ANK_TentativeDecl:
-        return TPResult::False();
+        return TPResult::False;
       case ANK_TemplateName:
         // A bare type template-name which can't be a template template
         // argument is an error, and was probably intended to be a type.
-        return GreaterThanIsOperator ? TPResult::True() : TPResult::False();
+        return GreaterThanIsOperator ? TPResult::True : TPResult::False;
       case ANK_Unresolved:
-        return HasMissingTypename ? TPResult::Ambiguous() : TPResult::False();
+        return HasMissingTypename ? TPResult::Ambiguous : TPResult::False;
       case ANK_Success:
         break;
       }
@@ -1155,12 +1155,12 @@
       // since it will annotate as a primary expression, and we want to use the
       // "missing 'typename'" logic.
       if (TryAnnotateTypeOrScopeToken())
-        return TPResult::Error();
+        return TPResult::Error;
       // If annotation failed, assume it's a non-type.
       // FIXME: If this happens due to an undeclared identifier, treat it as
       // ambiguous.
       if (Tok.is(tok::identifier))
-        return TPResult::False();
+        return TPResult::False;
     }
 
     // We annotated this token as something. Recurse to handle whatever we got.
@@ -1171,21 +1171,21 @@
     // Annotate typenames and C++ scope specifiers.  If we get one, just
     // recurse to handle whatever we get.
     if (TryAnnotateTypeOrScopeToken())
-      return TPResult::Error();
+      return TPResult::Error;
     return isCXXDeclarationSpecifier(BracedCastResult, HasMissingTypename);
 
   case tok::coloncolon: {    // ::foo::bar
     const Token &Next = NextToken();
     if (Next.is(tok::kw_new) ||    // ::new
         Next.is(tok::kw_delete))   // ::delete
-      return TPResult::False();
+      return TPResult::False;
   }
     // Fall through.
   case tok::kw_decltype:
     // Annotate typenames and C++ scope specifiers.  If we get one, just
     // recurse to handle whatever we get.
     if (TryAnnotateTypeOrScopeToken())
-      return TPResult::Error();
+      return TPResult::Error;
     return isCXXDeclarationSpecifier(BracedCastResult, HasMissingTypename);
 
     // decl-specifier:
@@ -1242,7 +1242,7 @@
   case tok::kw_restrict:
   case tok::kw__Complex:
   case tok::kw___attribute:
-    return TPResult::True();
+    return TPResult::True;
 
     // Microsoft
   case tok::kw___declspec:
@@ -1257,20 +1257,20 @@
   case tok::kw___ptr32:
   case tok::kw___forceinline:
   case tok::kw___unaligned:
-    return TPResult::True();
+    return TPResult::True;
 
     // Borland
   case tok::kw___pascal:
-    return TPResult::True();
+    return TPResult::True;
   
     // AltiVec
   case tok::kw___vector:
-    return TPResult::True();
+    return TPResult::True;
 
   case tok::annot_template_id: {
     TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
     if (TemplateId->Kind != TNK_Type_template)
-      return TPResult::False();
+      return TPResult::False;
     CXXScopeSpec SS;
     AnnotateTemplateIdTokenAsType();
     assert(Tok.is(tok::annot_typename));
@@ -1280,7 +1280,7 @@
   case tok::annot_cxxscope: // foo::bar or ::foo::bar, but already parsed
     // We've already annotated a scope; try to annotate a type.
     if (TryAnnotateTypeOrScopeToken())
-      return TPResult::Error();
+      return TPResult::Error;
     if (!Tok.is(tok::annot_typename)) {
       // If the next token is an identifier or a type qualifier, then this
       // can't possibly be a valid expression either.
@@ -1294,37 +1294,37 @@
           ConsumeToken();
           ConsumeToken();
           bool isIdentifier = Tok.is(tok::identifier);
-          TPResult TPR = TPResult::False();
+          TPResult TPR = TPResult::False;
           if (!isIdentifier)
             TPR = isCXXDeclarationSpecifier(BracedCastResult,
                                             HasMissingTypename);
           PA.Revert();
 
           if (isIdentifier ||
-              TPR == TPResult::True() || TPR == TPResult::Error())
-            return TPResult::Error();
+              TPR == TPResult::True || TPR == TPResult::Error)
+            return TPResult::Error;
 
           if (HasMissingTypename) {
             // We can't tell whether this is a missing 'typename' or a valid
             // expression.
             *HasMissingTypename = true;
-            return TPResult::Ambiguous();
+            return TPResult::Ambiguous;
           }
         } else {
           // Try to resolve the name. If it doesn't exist, assume it was
           // intended to name a type and keep disambiguating.
           switch (TryAnnotateName(false /* SS is not dependent */)) {
           case ANK_Error:
-            return TPResult::Error();
+            return TPResult::Error;
           case ANK_TentativeDecl:
-            return TPResult::False();
+            return TPResult::False;
           case ANK_TemplateName:
             // A bare type template-name which can't be a template template
             // argument is an error, and was probably intended to be a type.
-            return GreaterThanIsOperator ? TPResult::True() : TPResult::False();
+            return GreaterThanIsOperator ? TPResult::True : TPResult::False;
           case ANK_Unresolved:
-            return HasMissingTypename ? TPResult::Ambiguous()
-                                      : TPResult::False();
+            return HasMissingTypename ? TPResult::Ambiguous
+                                      : TPResult::False;
           case ANK_Success:
             // Annotated it, check again.
             assert(Tok.isNot(tok::annot_cxxscope) ||
@@ -1334,7 +1334,7 @@
           }
         }
       }
-      return TPResult::False();
+      return TPResult::False;
     }
     // If that succeeded, fallthrough into the generic simple-type-id case.
 
@@ -1370,16 +1370,16 @@
       
       PA.Revert();
       
-      if (TPR == TPResult::Error())
-        return TPResult::Error();
+      if (TPR == TPResult::Error)
+        return TPResult::Error;
       
       if (isFollowedByParen)
-        return TPResult::Ambiguous();
+        return TPResult::Ambiguous;
 
       if (getLangOpts().CPlusPlus11 && isFollowedByBrace)
         return BracedCastResult;
       
-      return TPResult::True();
+      return TPResult::True;
     }
       
   case tok::kw_char:
@@ -1400,7 +1400,7 @@
   case tok::kw_void:
   case tok::annot_decltype:
     if (NextToken().is(tok::l_paren))
-      return TPResult::Ambiguous();
+      return TPResult::Ambiguous;
 
     // This is a function-style cast in all cases we disambiguate other than
     // one:
@@ -1412,14 +1412,14 @@
       return BracedCastResult;
 
     if (isStartOfObjCClassMessageMissingOpenBracket())
-      return TPResult::False();
+      return TPResult::False;
       
-    return TPResult::True();
+    return TPResult::True;
 
   // GNU typeof support.
   case tok::kw_typeof: {
     if (NextToken().isNot(tok::l_paren))
-      return TPResult::True();
+      return TPResult::True;
 
     TentativeParsingAction PA(*this);
 
@@ -1429,28 +1429,28 @@
 
     PA.Revert();
 
-    if (TPR == TPResult::Error())
-      return TPResult::Error();
+    if (TPR == TPResult::Error)
+      return TPResult::Error;
 
     if (isFollowedByParen)
-      return TPResult::Ambiguous();
+      return TPResult::Ambiguous;
 
     if (getLangOpts().CPlusPlus11 && isFollowedByBrace)
       return BracedCastResult;
 
-    return TPResult::True();
+    return TPResult::True;
   }
 
   // C++0x type traits support
   case tok::kw___underlying_type:
-    return TPResult::True();
+    return TPResult::True;
 
   // C11 _Atomic
   case tok::kw__Atomic:
-    return TPResult::True();
+    return TPResult::True;
 
   default:
-    return TPResult::False();
+    return TPResult::False;
   }
 }
 
@@ -1516,9 +1516,9 @@
   // Parse through the parens after 'typeof'.
   ConsumeParen();
   if (!SkipUntil(tok::r_paren, StopAtSemi))
-    return TPResult::Error();
+    return TPResult::Error;
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// [ObjC] protocol-qualifiers:
@@ -1528,7 +1528,7 @@
   ConsumeToken();
   do {
     if (Tok.isNot(tok::identifier))
-      return TPResult::Error();
+      return TPResult::Error;
     ConsumeToken();
     
     if (Tok.is(tok::comma)) {
@@ -1538,11 +1538,11 @@
     
     if (Tok.is(tok::greater)) {
       ConsumeToken();
-      return TPResult::Ambiguous();
+      return TPResult::Ambiguous;
     }
   } while (false);
   
-  return TPResult::Error();
+  return TPResult::Error;
 }
 
 /// isCXXFunctionDeclarator - Disambiguates between a function declarator or
@@ -1571,9 +1571,9 @@
   ConsumeParen();
   bool InvalidAsDeclaration = false;
   TPResult TPR = TryParseParameterDeclarationClause(&InvalidAsDeclaration);
-  if (TPR == TPResult::Ambiguous()) {
+  if (TPR == TPResult::Ambiguous) {
     if (Tok.isNot(tok::r_paren))
-      TPR = TPResult::False();
+      TPR = TPResult::False;
     else {
       const Token &Next = NextToken();
       if (Next.is(tok::amp) || Next.is(tok::ampamp) ||
@@ -1585,20 +1585,20 @@
         // The next token cannot appear after a constructor-style initializer,
         // and can appear next in a function definition. This must be a function
         // declarator.
-        TPR = TPResult::True();
+        TPR = TPResult::True;
       else if (InvalidAsDeclaration)
         // Use the absence of 'typename' as a tie-breaker.
-        TPR = TPResult::False();
+        TPR = TPResult::False;
     }
   }
 
   PA.Revert();
 
-  if (IsAmbiguous && TPR == TPResult::Ambiguous())
+  if (IsAmbiguous && TPR == TPResult::Ambiguous)
     *IsAmbiguous = true;
 
   // In case of an error, let the declaration parsing code handle it.
-  return TPR != TPResult::False();
+  return TPR != TPResult::False;
 }
 
 /// parameter-declaration-clause:
@@ -1623,7 +1623,7 @@
                                            bool VersusTemplateArgument) {
 
   if (Tok.is(tok::r_paren))
-    return TPResult::Ambiguous();
+    return TPResult::Ambiguous;
 
   //   parameter-declaration-list[opt] '...'[opt]
   //   parameter-declaration-list ',' '...'
@@ -1637,15 +1637,15 @@
     if (Tok.is(tok::ellipsis)) {
       ConsumeToken();
       if (Tok.is(tok::r_paren))
-        return TPResult::True(); // '...)' is a sign of a function declarator.
+        return TPResult::True; // '...)' is a sign of a function declarator.
       else
-        return TPResult::False();
+        return TPResult::False;
     }
 
     // An attribute-specifier-seq here is a sign of a function declarator.
     if (isCXX11AttributeSpecifier(/*Disambiguate*/false,
                                   /*OuterMightBeMessageSend*/true))
-      return TPResult::True();
+      return TPResult::True;
 
     ParsedAttributes attrs(AttrFactory);
     MaybeParseMicrosoftAttributes(attrs);
@@ -1653,43 +1653,43 @@
     // decl-specifier-seq
     // A parameter-declaration's initializer must be preceded by an '=', so
     // decl-specifier-seq '{' is not a parameter in C++11.
-    TPResult TPR = isCXXDeclarationSpecifier(TPResult::False(),
+    TPResult TPR = isCXXDeclarationSpecifier(TPResult::False,
                                              InvalidAsDeclaration);
 
-    if (VersusTemplateArgument && TPR == TPResult::True()) {
+    if (VersusTemplateArgument && TPR == TPResult::True) {
       // Consume the decl-specifier-seq. We have to look past it, since a
       // type-id might appear here in a template argument.
       bool SeenType = false;
       do {
         SeenType |= isCXXDeclarationSpecifierAType();
-        if (TryConsumeDeclarationSpecifier() == TPResult::Error())
-          return TPResult::Error();
+        if (TryConsumeDeclarationSpecifier() == TPResult::Error)
+          return TPResult::Error;
 
         // If we see a parameter name, this can't be a template argument.
         if (SeenType && Tok.is(tok::identifier))
-          return TPResult::True();
+          return TPResult::True;
 
-        TPR = isCXXDeclarationSpecifier(TPResult::False(),
+        TPR = isCXXDeclarationSpecifier(TPResult::False,
                                         InvalidAsDeclaration);
-        if (TPR == TPResult::Error())
+        if (TPR == TPResult::Error)
           return TPR;
-      } while (TPR != TPResult::False());
-    } else if (TPR == TPResult::Ambiguous()) {
+      } while (TPR != TPResult::False);
+    } else if (TPR == TPResult::Ambiguous) {
       // Disambiguate what follows the decl-specifier.
-      if (TryConsumeDeclarationSpecifier() == TPResult::Error())
-        return TPResult::Error();
+      if (TryConsumeDeclarationSpecifier() == TPResult::Error)
+        return TPResult::Error;
     } else
       return TPR;
 
     // declarator
     // abstract-declarator[opt]
     TPR = TryParseDeclarator(true/*mayBeAbstract*/);
-    if (TPR != TPResult::Ambiguous())
+    if (TPR != TPResult::Ambiguous)
       return TPR;
 
     // [GNU] attributes[opt]
     if (Tok.is(tok::kw___attribute))
-      return TPResult::True();
+      return TPResult::True;
 
     // If we're disambiguating a template argument in a default argument in
     // a class definition versus a parameter declaration, an '=' here
@@ -1702,36 +1702,36 @@
     // parameter-declaration-clause, and the last param is missing its default
     // argument.
     if (VersusTemplateArgument)
-      return (Tok.is(tok::equal) || Tok.is(tok::r_paren)) ? TPResult::True()
-                                                          : TPResult::False();
+      return (Tok.is(tok::equal) || Tok.is(tok::r_paren)) ? TPResult::True
+                                                          : TPResult::False;
 
     if (Tok.is(tok::equal)) {
       // '=' assignment-expression
       // Parse through assignment-expression.
       // FIXME: assignment-expression may contain an unparenthesized comma.
       if (!SkipUntil(tok::comma, tok::r_paren, StopAtSemi | StopBeforeMatch))
-        return TPResult::Error();
+        return TPResult::Error;
     }
 
     if (Tok.is(tok::ellipsis)) {
       ConsumeToken();
       if (Tok.is(tok::r_paren))
-        return TPResult::True(); // '...)' is a sign of a function declarator.
+        return TPResult::True; // '...)' is a sign of a function declarator.
       else
-        return TPResult::False();
+        return TPResult::False;
     }
 
     if (!TryConsumeToken(tok::comma))
       break;
   }
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// TryParseFunctionDeclarator - We parsed a '(' and we want to try to continue
 /// parsing as a function declarator.
 /// If TryParseFunctionDeclarator fully parsed the function declarator, it will
-/// return TPResult::Ambiguous(), otherwise it will return either False() or
+/// return TPResult::Ambiguous, otherwise it will return either False() or
 /// Error().
 ///
 /// '(' parameter-declaration-clause ')' cv-qualifier-seq[opt]
@@ -1745,15 +1745,15 @@
   // The '(' is already parsed.
 
   TPResult TPR = TryParseParameterDeclarationClause();
-  if (TPR == TPResult::Ambiguous() && Tok.isNot(tok::r_paren))
-    TPR = TPResult::False();
+  if (TPR == TPResult::Ambiguous && Tok.isNot(tok::r_paren))
+    TPR = TPResult::False;
 
-  if (TPR == TPResult::False() || TPR == TPResult::Error())
+  if (TPR == TPResult::False || TPR == TPResult::Error)
     return TPR;
 
   // Parse through the parens.
   if (!SkipUntil(tok::r_paren, StopAtSemi))
-    return TPResult::Error();
+    return TPResult::Error;
 
   // cv-qualifier-seq
   while (Tok.is(tok::kw_const)    ||
@@ -1769,12 +1769,12 @@
   if (Tok.is(tok::kw_throw)) {
     ConsumeToken();
     if (Tok.isNot(tok::l_paren))
-      return TPResult::Error();
+      return TPResult::Error;
 
     // Parse through the parens after 'throw'.
     ConsumeParen();
     if (!SkipUntil(tok::r_paren, StopAtSemi))
-      return TPResult::Error();
+      return TPResult::Error;
   }
   if (Tok.is(tok::kw_noexcept)) {
     ConsumeToken();
@@ -1783,11 +1783,11 @@
       // Find the matching rparen.
       ConsumeParen();
       if (!SkipUntil(tok::r_paren, StopAtSemi))
-        return TPResult::Error();
+        return TPResult::Error;
     }
   }
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }
 
 /// '[' constant-expression[opt] ']'
@@ -1795,7 +1795,7 @@
 Parser::TPResult Parser::TryParseBracketDeclarator() {
   ConsumeBracket();
   if (!SkipUntil(tok::r_square, StopAtSemi))
-    return TPResult::Error();
+    return TPResult::Error;
 
-  return TPResult::Ambiguous();
+  return TPResult::Ambiguous;
 }