================ @@ -5347,13 +5347,16 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: - ClsType = QualType(NNS->getAsType(), 0); + const Type *NNSType = NNS->getAsType(); + ClsType = QualType(NNSType, 0); // Note: if the NNS has a prefix and ClsType is a nondependent - // TemplateSpecializationType, then the NNS prefix is NOT included - // in ClsType; hence we wrap ClsType into an ElaboratedType. - // NOTE: in particular, no wrap occurs if ClsType already is an - // Elaborated, DependentName, or DependentTemplateSpecialization. - if (isa<TemplateSpecializationType>(NNS->getAsType())) + // TemplateSpecializationType or a RecordType, then the NNS prefix is + // NOT included in ClsType; hence we wrap ClsType into an + // ElaboratedType. NOTE: in particular, no wrap occurs if ClsType + // already is an Elaborated, DependentName, or + // DependentTemplateSpecialization. + if (isa<TemplateSpecializationType>(NNSType) || + (NNSPrefix && isa<RecordType>(NNSType))) ---------------- mizvekov wrote:
```suggestion isa<RecordType>(NNSType)) ``` We use an ElaboratedType with null prefix to represent a type which was written without qualifiers, so it seems arbitrary to not add the elaboration in this case. Also, can you at least add a FIXME / TODO explaining how a DependentTemplateSpecializationType needs to be handled here, as I explained in the other thread? https://github.com/llvm/llvm-project/pull/118236 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits