@@ -26,51 +26,14 @@ ExprResult Parser::ParseCXXReflectExpression() {
26
26
EnterExpressionEvaluationContext EvalContext (
27
27
Actions, Sema::ExpressionEvaluationContext::ReflectionContext);
28
28
29
- // ^ template [:splice-specifier:]
30
- //
31
- SourceLocation TemplateKWLoc;
32
- if (Tok.is (tok::kw_template)) {
33
- TemplateKWLoc = ConsumeToken ();
34
-
35
- if (!Tok.is (tok::l_splice)) {
36
- Diag (TemplateKWLoc, diag::err_unexpected_template_in_unqualified_id);
37
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
38
- return ExprError ();
39
- }
40
-
41
- if (ParseCXXSpliceSpecifier (TemplateKWLoc)) {
42
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
43
- return ExprError ();
44
- }
45
-
46
- if (!NextToken ().is (tok::less)) {
47
- Token Splice = Tok;
48
- TemplateTy Template = ParseCXXSpliceAsTemplate ();
49
- if (Template)
50
- return Actions.BuildCXXReflectExpr (OpLoc, Splice.getLocation (),
51
- Template.get ());
52
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
53
- return ExprError ();
54
- }
55
-
56
- if (ParseTemplateAnnotationFromSplice (SourceLocation (), false , false ,
57
- /* Complain=*/ true )) {
58
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
59
- return ExprError ();
60
- }
61
- }
62
-
63
-
64
29
// Parse a leading nested-name-specifier, e.g.,
65
30
//
66
31
CXXScopeSpec SS;
67
- if (TemplateKWLoc.isInvalid ()) {
68
- if (ParseOptionalCXXScopeSpecifier (SS, /* ObjectType=*/ nullptr ,
69
- /* ObjectHasErrors=*/ false ,
70
- /* EnteringContext=*/ false )) {
71
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
72
- return ExprError ();
73
- }
32
+ if (ParseOptionalCXXScopeSpecifier (SS, /* ObjectType=*/ nullptr ,
33
+ /* ObjectHasErrors=*/ false ,
34
+ /* EnteringContext=*/ false )) {
35
+ SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
36
+ return ExprError ();
74
37
}
75
38
76
39
// Start the tentative parse: This will be reverted if the operand is found
@@ -79,24 +42,6 @@ ExprResult Parser::ParseCXXReflectExpression() {
79
42
//
80
43
TentativeParsingAction TentativeAction (*this );
81
44
82
- // ^ [:splice-specifier:]
83
- //
84
- if (!SS.isSet () && Tok.is (tok::annot_splice)) {
85
- assert (TemplateKWLoc.isInvalid ());
86
-
87
- ExprResult ER = getExprAnnotation (Tok);
88
- assert (!ER.isInvalid ());
89
- ER = ParseCXXSpliceAsExpr (true );
90
- if (ER.isInvalid ()) {
91
- TentativeAction.Commit ();
92
- SkipUntil (tok::semi, StopAtSemi | StopBeforeMatch);
93
- return ExprError ();
94
- }
95
-
96
- TentativeAction.Commit ();
97
- return Actions.ActOnCXXReflectExpr (OpLoc, cast<CXXSpliceExpr>(ER.get ()));
98
- }
99
-
100
45
// Next, check for an unqualified-id.
101
46
if (Tok.isOneOf (tok::identifier, tok::kw_operator, tok::kw_template,
102
47
tok::tilde, tok::annot_template_id)) {
0 commit comments