diff options
| author | Faisal Vali <faisalv@yahoo.com> | 2017-04-01 21:30:49 +0000 | 
|---|---|---|
| committer | Faisal Vali <faisalv@yahoo.com> | 2017-04-01 21:30:49 +0000 | 
| commit | d143a0c2de1311575633de3c6a3f55b101889229 (patch) | |
| tree | c2e69d0ca1363f458b6be56e8b478b8e45f3e8de /clang/lib/Parse/ParseExprCXX.cpp | |
| parent | 1a3665bb828c28781ade8252a40d6d5a682fcd66 (diff) | |
| download | bcm5719-llvm-d143a0c2de1311575633de3c6a3f55b101889229.tar.gz bcm5719-llvm-d143a0c2de1311575633de3c6a3f55b101889229.zip | |
[NFC, Scoped Enum] Convert Sema::ExpressionEvaluationContext into a scoped Enum
- also replace direct equality checks against the ConstantEvaluated enumerator  with isConstantEvaluted(), in anticipation of adding finer granularity to the various ConstantEvaluated contexts and reinstating certain restrictions on where lambda expressions can occur in C++17.
- update the clang tablegen backend that uses these Enumerators, and add the relevant scope where needed.
llvm-svn: 299316
Diffstat (limited to 'clang/lib/Parse/ParseExprCXX.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseExprCXX.cpp | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/clang/lib/Parse/ParseExprCXX.cpp b/clang/lib/Parse/ParseExprCXX.cpp index b549f60ce09..671a815911f 100644 --- a/clang/lib/Parse/ParseExprCXX.cpp +++ b/clang/lib/Parse/ParseExprCXX.cpp @@ -866,8 +866,8 @@ Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro,          // Each lambda init-capture forms its own full expression, which clears          // Actions.MaybeODRUseExprs. So create an expression evaluation context          // to save the necessary state, and restore it later. -        EnterExpressionEvaluationContext EC(Actions, -                                            Sema::PotentiallyEvaluated); +        EnterExpressionEvaluationContext EC( +            Actions, Sema::ExpressionEvaluationContext::PotentiallyEvaluated);          if (TryConsumeToken(tok::equal))            InitKind = LambdaCaptureInitKind::CopyInit; @@ -1405,8 +1405,9 @@ ExprResult Parser::ParseCXXTypeid() {    // We enter the unevaluated context before trying to determine whether we    // have a type-id, because the tentative parse logic will try to resolve    // names, and must treat them as unevaluated. -  EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated, -                                               Sema::ReuseLambdaContextDecl); +  EnterExpressionEvaluationContext Unevaluated( +      Actions, Sema::ExpressionEvaluationContext::Unevaluated, +      Sema::ReuseLambdaContextDecl);    if (isTypeIdInParens()) {      TypeResult Ty = ParseTypeName(); @@ -1469,7 +1470,8 @@ ExprResult Parser::ParseCXXUuidof() {                                      Ty.get().getAsOpaquePtr(),                                       T.getCloseLocation());    } else { -    EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); +    EnterExpressionEvaluationContext Unevaluated( +        Actions, Sema::ExpressionEvaluationContext::Unevaluated);      Result = ParseExpression();      // Match the ')'. | 

