@@ -2718,34 +2718,6 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
2718
2718
return ExprError();
2719
2719
}
2720
2720
2721
- // C++ [temp.dep.expr]p3:
2722
- // An id-expression is type-dependent if it contains:
2723
- // -- an identifier that was declared with a dependent type,
2724
- // (note: handled after lookup)
2725
- // -- a template-id that is dependent,
2726
- // (note: handled in BuildTemplateIdExpr)
2727
- // -- a conversion-function-id that specifies a dependent type,
2728
- // -- a nested-name-specifier that contains a class-name that
2729
- // names a dependent type.
2730
- // Determine whether this is a member of an unknown specialization;
2731
- // we need to handle these differently.
2732
- bool DependentID = false;
2733
- if (Name.getNameKind() == DeclarationName::CXXConversionFunctionName &&
2734
- Name.getCXXNameType()->isDependentType()) {
2735
- DependentID = true;
2736
- } else if (SS.isSet()) {
2737
- if (DeclContext *DC = computeDeclContext(SS, false)) {
2738
- if (RequireCompleteDeclContext(SS, DC))
2739
- return ExprError();
2740
- } else {
2741
- DependentID = true;
2742
- }
2743
- }
2744
-
2745
- if (DependentID)
2746
- return ActOnDependentIdExpression(SS, TemplateKWLoc, NameInfo,
2747
- IsAddressOfOperand, TemplateArgs);
2748
-
2749
2721
// BoundsSafety: This specially handles arguments of bounds attributes
2750
2722
// appertains to a type of C struct field such that the name lookup
2751
2723
// within a struct finds the member name, which is not the case for other
@@ -2781,7 +2753,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
2781
2753
&AssumedTemplate))
2782
2754
return ExprError();
2783
2755
2784
- if (R.wasNotFoundInCurrentInstantiation())
2756
+ if (R.wasNotFoundInCurrentInstantiation() || SS.isInvalid() )
2785
2757
return ActOnDependentIdExpression(SS, TemplateKWLoc, NameInfo,
2786
2758
IsAddressOfOperand, TemplateArgs);
2787
2759
} else {
@@ -2791,7 +2763,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
2791
2763
2792
2764
// If the result might be in a dependent base class, this is a dependent
2793
2765
// id-expression.
2794
- if (R.wasNotFoundInCurrentInstantiation())
2766
+ if (R.wasNotFoundInCurrentInstantiation() || SS.isInvalid() )
2795
2767
return ActOnDependentIdExpression(SS, TemplateKWLoc, NameInfo,
2796
2768
IsAddressOfOperand, TemplateArgs);
2797
2769
@@ -3177,7 +3149,7 @@ bool Sema::UseArgumentDependentLookup(const CXXScopeSpec &SS,
3177
3149
return false;
3178
3150
3179
3151
// Never if a scope specifier was provided.
3180
- if (SS.isSet ())
3152
+ if (SS.isNotEmpty ())
3181
3153
return false;
3182
3154
3183
3155
// Only in C++ or ObjC++.
0 commit comments