28 using namespace clang;
52 return Name1 == Name2;
66 if ((
bool)Prefix1 != (
bool)Prefix2)
70 if (!IsStructurallyEquivalent(Context, Prefix1, Prefix2))
74 case NestedNameSpecifier::Identifier:
77 case NestedNameSpecifier::Namespace:
80 case NestedNameSpecifier::NamespaceAlias:
83 case NestedNameSpecifier::TypeSpec:
84 case NestedNameSpecifier::TypeSpecWithTemplate:
87 case NestedNameSpecifier::Global:
89 case NestedNameSpecifier::Super:
102 case TemplateName::Template:
106 case TemplateName::OverloadedTemplate: {
110 E1 = OS1->
end(), E2 = OS2->end();
111 for (; I1 != E1 && I2 != E2; ++I1, ++I2)
112 if (!IsStructurallyEquivalent(Context, *I1, *I2))
114 return I1 == E1 && I2 == E2;
117 case TemplateName::QualifiedTemplate: {
120 return IsStructurallyEquivalent(Context, QN1->
getDecl(), QN2->getDecl()) &&
122 QN2->getQualifier());
125 case TemplateName::DependentTemplate: {
128 if (!IsStructurallyEquivalent(Context, DN1->
getQualifier(),
129 DN2->getQualifier()))
133 DN2->getIdentifier());
139 case TemplateName::SubstTemplateTemplateParm: {
142 return IsStructurallyEquivalent(Context, TS1->
getParameter(),
143 TS2->getParameter()) &&
145 TS2->getReplacement());
147 case TemplateName::SubstTemplateTemplateParmPack: {
152 P2->getArgumentPack()) &&
154 P2->getParameterPack());
168 case TemplateArgument::Null:
171 case TemplateArgument::Type:
174 case TemplateArgument::Integral:
182 case TemplateArgument::Declaration:
185 case TemplateArgument::NullPtr:
188 case TemplateArgument::Template:
189 return IsStructurallyEquivalent(Context, Arg1.
getAsTemplate(),
192 case TemplateArgument::TemplateExpansion:
193 return IsStructurallyEquivalent(Context,
197 case TemplateArgument::Expression:
198 return IsStructurallyEquivalent(Context, Arg1.
getAsExpr(),
201 case TemplateArgument::Pack:
206 if (!IsStructurallyEquivalent(Context, Arg1.
pack_begin()[
I],
213 llvm_unreachable(
"Invalid template argument kind");
255 TC = Type::FunctionNoProto;
258 TC = Type::FunctionNoProto;
266 if (cast<BuiltinType>(T1)->getKind() != cast<BuiltinType>(T2)->
getKind())
271 if (!IsStructurallyEquivalent(Context,
272 cast<ComplexType>(T1)->getElementType(),
273 cast<ComplexType>(T2)->getElementType()))
279 if (!IsStructurallyEquivalent(Context,
280 cast<AdjustedType>(T1)->getOriginalType(),
281 cast<AdjustedType>(T2)->getOriginalType()))
286 if (!IsStructurallyEquivalent(Context,
287 cast<PointerType>(T1)->getPointeeType(),
288 cast<PointerType>(T2)->getPointeeType()))
292 case Type::BlockPointer:
293 if (!IsStructurallyEquivalent(Context,
294 cast<BlockPointerType>(T1)->getPointeeType(),
295 cast<BlockPointerType>(T2)->getPointeeType()))
299 case Type::LValueReference:
300 case Type::RValueReference: {
308 Ref2->getPointeeTypeAsWritten()))
313 case Type::MemberPointer: {
325 case Type::ConstantArray: {
328 if (!llvm::APInt::isSameValue(Array1->
getSize(), Array2->getSize()))
331 if (!IsArrayStructurallyEquivalent(Context, Array1, Array2))
336 case Type::IncompleteArray:
337 if (!IsArrayStructurallyEquivalent(Context, cast<ArrayType>(T1),
338 cast<ArrayType>(T2)))
342 case Type::VariableArray: {
345 if (!IsStructurallyEquivalent(Context, Array1->
getSizeExpr(),
346 Array2->getSizeExpr()))
349 if (!IsArrayStructurallyEquivalent(Context, Array1, Array2))
355 case Type::DependentSizedArray: {
358 if (!IsStructurallyEquivalent(Context, Array1->
getSizeExpr(),
359 Array2->getSizeExpr()))
362 if (!IsArrayStructurallyEquivalent(Context, Array1, Array2))
368 case Type::DependentSizedExtVector: {
370 cast<DependentSizedExtVectorType>(T1);
372 cast<DependentSizedExtVectorType>(T2);
373 if (!IsStructurallyEquivalent(Context, Vec1->
getSizeExpr(),
374 Vec2->getSizeExpr()))
377 Vec2->getElementType()))
383 case Type::ExtVector: {
384 const VectorType *Vec1 = cast<VectorType>(T1);
385 const VectorType *Vec2 = cast<VectorType>(T2);
387 Vec2->getElementType()))
396 case Type::FunctionProto: {
402 if (!IsStructurallyEquivalent(Context, Proto1->
getParamType(
I),
403 Proto2->getParamType(
I)))
406 if (Proto1->
isVariadic() != Proto2->isVariadic())
415 Proto2->getExceptionType(
I)))
420 Proto2->getNoexceptExpr()))
430 case Type::FunctionNoProto: {
433 if (!IsStructurallyEquivalent(Context, Function1->
getReturnType(),
434 Function2->getReturnType()))
436 if (Function1->
getExtInfo() != Function2->getExtInfo())
441 case Type::UnresolvedUsing:
442 if (!IsStructurallyEquivalent(Context,
443 cast<UnresolvedUsingType>(T1)->getDecl(),
444 cast<UnresolvedUsingType>(T2)->getDecl()))
449 case Type::Attributed:
450 if (!IsStructurallyEquivalent(Context,
451 cast<AttributedType>(T1)->getModifiedType(),
452 cast<AttributedType>(T2)->getModifiedType()))
454 if (!IsStructurallyEquivalent(
455 Context, cast<AttributedType>(T1)->getEquivalentType(),
456 cast<AttributedType>(T2)->getEquivalentType()))
461 if (!IsStructurallyEquivalent(Context, cast<ParenType>(T1)->getInnerType(),
462 cast<ParenType>(T2)->getInnerType()))
467 if (!IsStructurallyEquivalent(Context, cast<TypedefType>(T1)->getDecl(),
468 cast<TypedefType>(T2)->getDecl()))
472 case Type::TypeOfExpr:
473 if (!IsStructurallyEquivalent(
474 Context, cast<TypeOfExprType>(T1)->getUnderlyingExpr(),
475 cast<TypeOfExprType>(T2)->getUnderlyingExpr()))
480 if (!IsStructurallyEquivalent(Context,
486 case Type::UnaryTransform:
487 if (!IsStructurallyEquivalent(
494 if (!IsStructurallyEquivalent(Context,
495 cast<DecltypeType>(T1)->getUnderlyingExpr(),
496 cast<DecltypeType>(T2)->getUnderlyingExpr()))
501 if (!IsStructurallyEquivalent(Context, cast<AutoType>(T1)->getDeducedType(),
502 cast<AutoType>(T2)->getDeducedType()))
506 case Type::DeducedTemplateSpecialization: {
507 auto *DT1 = cast<DeducedTemplateSpecializationType>(T1);
508 auto *DT2 = cast<DeducedTemplateSpecializationType>(T2);
509 if (!IsStructurallyEquivalent(Context, DT1->getTemplateName(),
510 DT2->getTemplateName()))
512 if (!IsStructurallyEquivalent(Context, DT1->getDeducedType(),
513 DT2->getDeducedType()))
520 if (!IsStructurallyEquivalent(Context, cast<TagType>(T1)->getDecl(),
521 cast<TagType>(T2)->getDecl()))
525 case Type::TemplateTypeParm: {
528 if (Parm1->
getDepth() != Parm2->getDepth())
530 if (Parm1->
getIndex() != Parm2->getIndex())
539 case Type::SubstTemplateTypeParm: {
541 cast<SubstTemplateTypeParmType>(T1);
543 cast<SubstTemplateTypeParmType>(T2);
544 if (!IsStructurallyEquivalent(Context,
546 QualType(Subst2->getReplacedParameter(), 0)))
549 Subst2->getReplacementType()))
554 case Type::SubstTemplateTypeParmPack: {
556 cast<SubstTemplateTypeParmPackType>(T1);
558 cast<SubstTemplateTypeParmPackType>(T2);
559 if (!IsStructurallyEquivalent(Context,
561 QualType(Subst2->getReplacedParameter(), 0)))
564 Subst2->getArgumentPack()))
568 case Type::TemplateSpecialization: {
570 cast<TemplateSpecializationType>(T1);
572 cast<TemplateSpecializationType>(T2);
574 Spec2->getTemplateName()))
576 if (Spec1->
getNumArgs() != Spec2->getNumArgs())
579 if (!IsStructurallyEquivalent(Context, Spec1->
getArg(
I),
586 case Type::Elaborated: {
590 if (Elab1->
getKeyword() != Elab2->getKeyword())
592 if (!IsStructurallyEquivalent(Context, Elab1->
getQualifier(),
593 Elab2->getQualifier()))
595 if (!IsStructurallyEquivalent(Context, Elab1->
getNamedType(),
596 Elab2->getNamedType()))
601 case Type::InjectedClassName: {
604 if (!IsStructurallyEquivalent(Context,
606 Inj2->getInjectedSpecializationType()))
611 case Type::DependentName: {
614 if (!IsStructurallyEquivalent(Context, Typename1->
getQualifier(),
615 Typename2->getQualifier()))
618 Typename2->getIdentifier()))
624 case Type::DependentTemplateSpecialization: {
626 cast<DependentTemplateSpecializationType>(T1);
628 cast<DependentTemplateSpecializationType>(T2);
629 if (!IsStructurallyEquivalent(Context, Spec1->
getQualifier(),
630 Spec2->getQualifier()))
633 Spec2->getIdentifier()))
635 if (Spec1->
getNumArgs() != Spec2->getNumArgs())
638 if (!IsStructurallyEquivalent(Context, Spec1->
getArg(
I),
645 case Type::PackExpansion:
646 if (!IsStructurallyEquivalent(Context,
647 cast<PackExpansionType>(T1)->getPattern(),
648 cast<PackExpansionType>(T2)->getPattern()))
652 case Type::ObjCInterface: {
655 if (!IsStructurallyEquivalent(Context, Iface1->
getDecl(),
661 case Type::ObjCTypeParam: {
664 if (!IsStructurallyEquivalent(Context, Obj1->
getDecl(), Obj2->getDecl()))
670 if (!IsStructurallyEquivalent(Context, Obj1->
getProtocol(
I),
671 Obj2->getProtocol(
I)))
676 case Type::ObjCObject: {
679 if (!IsStructurallyEquivalent(Context, Obj1->
getBaseType(),
680 Obj2->getBaseType()))
685 if (!IsStructurallyEquivalent(Context, Obj1->
getProtocol(
I),
686 Obj2->getProtocol(
I)))
692 case Type::ObjCObjectPointer: {
702 if (!IsStructurallyEquivalent(Context, cast<AtomicType>(T1)->getValueType(),
703 cast<AtomicType>(T2)->getValueType()))
709 if (!IsStructurallyEquivalent(Context, cast<PipeType>(T1)->getElementType(),
710 cast<PipeType>(T2)->getElementType()))
732 return IsStructurallyEquivalent(Context, D1, D2);
738 if (!::IsStructurallyEquivalent(Name1, Name2)) {
742 ? diag::err_odr_tag_type_inconsistent
743 : diag::warn_odr_tag_type_inconsistent)
753 if (!IsStructurallyEquivalent(Context, Field1->
getType(),
758 ? diag::err_odr_tag_type_inconsistent
759 : diag::warn_odr_tag_type_inconsistent)
773 ? diag::err_odr_tag_type_inconsistent
774 : diag::warn_odr_tag_type_inconsistent)
798 if (Bits1 != Bits2) {
802 ? diag::err_odr_tag_type_inconsistent
803 : diag::warn_odr_tag_type_inconsistent)
824 ? diag::err_odr_tag_type_inconsistent
825 : diag::warn_odr_tag_type_inconsistent)
837 StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(D1)) {
839 StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(
841 if (*Index1 != *Index2)
853 if (Spec1 && Spec2) {
856 Spec2->getSpecializedTemplate()))
865 Spec2->getTemplateArgs().get(
I)))
870 else if (Spec1 || Spec2)
882 if (D1CXX->hasExternalLexicalStorage() &&
883 !D1CXX->isCompleteDefinition()) {
887 if (D1CXX->getNumBases() != D2CXX->getNumBases()) {
892 << D2CXX->getNumBases();
894 << D1CXX->getNumBases();
901 BaseEnd1 = D1CXX->bases_end(),
902 Base2 = D2CXX->bases_begin();
903 Base1 != BaseEnd1; ++Base1, ++Base2) {
904 if (!IsStructurallyEquivalent(Context, Base1->getType(),
908 diag::warn_odr_tag_type_inconsistent)
910 Context.
Diag2(Base2->getLocStart(), diag::note_odr_base)
911 << Base2->getType() << Base2->getSourceRange();
912 Context.
Diag1(Base1->getLocStart(), diag::note_odr_base)
913 << Base1->getType() << Base1->getSourceRange();
919 if (Base1->isVirtual() != Base2->isVirtual()) {
922 diag::warn_odr_tag_type_inconsistent)
924 Context.
Diag2(Base2->getLocStart(), diag::note_odr_virtual_base)
925 << Base2->isVirtual() << Base2->getSourceRange();
926 Context.
Diag1(Base1->getLocStart(), diag::note_odr_base)
927 << Base1->isVirtual() << Base1->getSourceRange();
932 }
else if (D1CXX->getNumBases() > 0) {
950 Field1 != Field1End; ++Field1, ++Field2) {
951 if (Field2 == Field2End) {
955 ? diag::err_odr_tag_type_inconsistent
956 : diag::warn_odr_tag_type_inconsistent)
965 if (!IsStructurallyEquivalent(Context, *Field1, *Field2))
969 if (Field2 != Field2End) {
973 ? diag::err_odr_tag_type_inconsistent
974 : diag::warn_odr_tag_type_inconsistent)
976 Context.
Diag2(Field2->getLocation(), diag::note_odr_field)
977 << Field2->getDeclName() << Field2->getType();
993 EC1 != EC1End; ++EC1, ++EC2) {
998 ? diag::err_odr_tag_type_inconsistent
999 : diag::warn_odr_tag_type_inconsistent)
1001 Context.
Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1002 << EC1->getDeclName() << EC1->getInitVal().toString(10);
1008 llvm::APSInt Val1 = EC1->getInitVal();
1009 llvm::APSInt Val2 = EC2->getInitVal();
1010 if (!llvm::APSInt::isSameValue(Val1, Val2) ||
1011 !IsStructurallyEquivalent(EC1->getIdentifier(), EC2->getIdentifier())) {
1015 ? diag::err_odr_tag_type_inconsistent
1016 : diag::warn_odr_tag_type_inconsistent)
1018 Context.
Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1019 << EC2->getDeclName() << EC2->getInitVal().toString(10);
1020 Context.
Diag1(EC1->getLocation(), diag::note_odr_enumerator)
1021 << EC1->getDeclName() << EC1->getInitVal().toString(10);
1027 if (EC2 != EC2End) {
1031 ? diag::err_odr_tag_type_inconsistent
1032 : diag::warn_odr_tag_type_inconsistent)
1034 Context.
Diag2(EC2->getLocation(), diag::note_odr_enumerator)
1035 << EC2->getDeclName() << EC2->getInitVal().toString(10);
1047 if (Params1->
size() != Params2->
size()) {
1050 diag::err_odr_different_num_template_parameters)
1051 << Params1->
size() << Params2->
size();
1053 diag::note_odr_template_parameter_list);
1058 for (
unsigned I = 0, N = Params1->
size();
I != N; ++
I) {
1062 diag::err_odr_different_template_parameter_kind);
1064 diag::note_odr_template_parameter_here);
1112 diag::err_odr_non_type_parameter_type_inconsistent)
1181 assert(Complain &&
"Not allowed to complain");
1183 FromCtx.getDiagnostics().notePriorDiagnosticFrom(ToCtx.getDiagnostics());
1184 LastDiagFromC2 =
false;
1185 return FromCtx.getDiagnostics().Report(Loc, DiagID);
1190 assert(Complain &&
"Not allowed to complain");
1191 if (!LastDiagFromC2)
1192 ToCtx.getDiagnostics().notePriorDiagnosticFrom(FromCtx.getDiagnostics());
1193 LastDiagFromC2 =
true;
1194 return ToCtx.getDiagnostics().Report(Loc, DiagID);
1198 StructuralEquivalenceContext::findUntaggedStructOrUnionIndex(
RecordDecl *Anon) {
1212 if (F->isAnonymousStructOrUnion()) {
1222 if (
const auto *RecType = dyn_cast<RecordType>(FieldType)) {
1223 const RecordDecl *RecDecl = RecType->getDecl();
1236 bool StructuralEquivalenceContext::IsStructurallyEquivalent(
Decl *D1,
1238 if (!::IsStructurallyEquivalent(*
this, D1, D2))
1244 bool StructuralEquivalenceContext::IsStructurallyEquivalent(
QualType T1,
1246 if (!::IsStructurallyEquivalent(*
this, T1, T2))
1252 bool StructuralEquivalenceContext::Finish() {
1253 while (!DeclsToCheck.empty()) {
1255 Decl *D1 = DeclsToCheck.front();
1256 DeclsToCheck.pop_front();
1258 Decl *D2 = TentativeEquivalences[D1];
1259 assert(D2 &&
"Unrecorded tentative equivalence?");
1261 bool Equivalent =
true;
1265 if (
RecordDecl *Record1 = dyn_cast<RecordDecl>(D1)) {
1266 if (
RecordDecl *Record2 = dyn_cast<RecordDecl>(D2)) {
1269 if (!Name1 && Record1->getTypedefNameForAnonDecl())
1270 Name1 = Record1->getTypedefNameForAnonDecl()->getIdentifier();
1272 if (!Name2 && Record2->getTypedefNameForAnonDecl())
1273 Name2 = Record2->getTypedefNameForAnonDecl()->getIdentifier();
1274 if (!::IsStructurallyEquivalent(Name1, Name2) ||
1275 !::IsStructurallyEquivalent(*
this, Record1, Record2))
1281 }
else if (
EnumDecl *Enum1 = dyn_cast<EnumDecl>(D1)) {
1282 if (
EnumDecl *Enum2 = dyn_cast<EnumDecl>(D2)) {
1285 if (!Name1 && Enum1->getTypedefNameForAnonDecl())
1286 Name1 = Enum1->getTypedefNameForAnonDecl()->getIdentifier();
1288 if (!Name2 && Enum2->getTypedefNameForAnonDecl())
1289 Name2 = Enum2->getTypedefNameForAnonDecl()->getIdentifier();
1290 if (!::IsStructurallyEquivalent(Name1, Name2) ||
1291 !::IsStructurallyEquivalent(*
this, Enum1, Enum2))
1297 }
else if (
TypedefNameDecl *Typedef1 = dyn_cast<TypedefNameDecl>(D1)) {
1299 if (!::IsStructurallyEquivalent(Typedef1->getIdentifier(),
1300 Typedef2->getIdentifier()) ||
1301 !::IsStructurallyEquivalent(*
this, Typedef1->getUnderlyingType(),
1302 Typedef2->getUnderlyingType()))
1309 dyn_cast<ClassTemplateDecl>(D1)) {
1311 if (!::IsStructurallyEquivalent(ClassTemplate1->getIdentifier(),
1312 ClassTemplate2->getIdentifier()) ||
1313 !::IsStructurallyEquivalent(*
this, ClassTemplate1, ClassTemplate2))
1320 dyn_cast<TemplateTypeParmDecl>(D1)) {
1322 if (!::IsStructurallyEquivalent(*
this, TTP1, TTP2))
1329 dyn_cast<NonTypeTemplateParmDecl>(D1)) {
1331 dyn_cast<NonTypeTemplateParmDecl>(D2)) {
1332 if (!::IsStructurallyEquivalent(*
this, NTTP1, NTTP2))
1339 dyn_cast<TemplateTemplateParmDecl>(D1)) {
1341 dyn_cast<TemplateTemplateParmDecl>(D2)) {
1342 if (!::IsStructurallyEquivalent(*
this, TTP1, TTP2))
1353 NonEquivalentDecls.insert(
unsigned getNumElements() const
Defines the clang::ASTContext interface.
QualType getExceptionType(unsigned i) const
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
Expr * getSizeExpr() const
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
unsigned getDepth() const
A (possibly-)qualified type.
TemplateName getReplacement() const
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
bool isBitField() const
Determines whether this field is a bitfield.
QualType getType() const
Retrieves the type of the base class.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
bool isParameterPack() const
Returns whether this is a parameter pack.
FunctionType - C99 6.7.5.3 - Function Declarators.
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
unsigned getNumArgs() const
Retrieve the number of template arguments.
OverloadedOperatorKind getOperator() const
Return the overloaded operator to which this template name refers.
Defines the SourceManager interface.
Represents a qualified type name for which the type name is dependent.
CXXRecordDecl * getTemplatedDecl() const
Get the underlying class declarations of the template.
Decl - This represents one declaration (or definition), e.g.
pack_iterator pack_begin() const
Iterator referencing the first argument of a template argument pack.
QualType getPointeeType() const
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
enumerator_iterator enumerator_end() const
QualType getRecordType(const RecordDecl *Decl) const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
TemplateTemplateParmDecl * getParameterPack() const
Retrieve the template template parameter pack being substituted.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
NamedDecl * getParam(unsigned Idx)
unsigned getIndex() const
Expr * getAsExpr() const
Retrieve the template argument as an expression.
enumerator_iterator enumerator_begin() const
const TemplateArgument & get(unsigned Idx) const
Retrieve the template argument at a given index.
bool isSpelledAsLValue() const
const llvm::APInt & getSize() const
field_iterator field_begin() const
ASTContext & FromCtx
AST contexts for which we are checking structural equivalence.
Stores a list of template parameters for a TemplateDecl and its derived classes.
Qualifiers getIndexTypeQualifiers() const
TemplateTemplateParmDecl * getParameter() const
Represents the result of substituting a type for a template type parameter.
unsigned getNumArgs() const
Retrieve the number of template arguments.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
unsigned getNumParams() const
RecordDecl - Represents a struct/union/class.
const IdentifierInfo * getIdentifier() const
Retrieve the type named by the typename specifier as an identifier.
QualType getElementType() const
Represents a class template specialization, which refers to a class template with a given set of temp...
One of these records is kept for each identifier that is lexed.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
Represents a class type in Objective C.
Expr * getSizeExpr() const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a dependent template name that cannot be resolved prior to template instantiation.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
SourceLocation getLocStart() const LLVM_READONLY
bool ErrorOnTagTypeMismatch
Whether warn or error on tag type mismatches.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
unsigned size() const
Retrieve the number of template arguments in this template argument list.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
TagKind getTagKind() const
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Represents the result of substituting a set of types for a template type parameter pack...
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
bool StrictTypeSpelling
Whether we're being strict about the spelling of types when unifying two types.
TemplateArgument getArgumentPack() const
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
QualType getBaseType() const
Gets the base type of this object type.
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
QualType getReturnType() const
TemplateArgument getArgumentPack() const
Retrieve the template template argument pack with which this parameter was substituted.
Expr * getNoexceptExpr() const
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
TypeClass getTypeClass() const
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
detail::InMemoryDirectory::const_iterator I
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Represents an extended vector type where either the type or size is dependent.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
field_iterator field_end() const
bool IsStructurallyEquivalent(Decl *D1, Decl *D2)
Determine whether the two declarations are structurally equivalent.
QualType getInjectedSpecializationType() const
ExtInfo getExtInfo() const
A little helper class used to produce diagnostics.
QualType getParamType(unsigned i) const
Represents a prototype with parameter type info, e.g.
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee...
Represents an array type in C++ whose size is a value-dependent expression.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID)
Expr - This represents one expression.
StringRef getName() const
Return the actual identifier string.
Declaration of a template type parameter.
QualType getNamedType() const
Retrieve the type named by the qualified-id.
ArgKind getKind() const
Return the kind of stored template argument.
DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID)
DeclContext * getDeclContext()
A structure for storing the information associated with a substituted template template parameter...
SubstTemplateTemplateParmPackStorage * getAsSubstTemplateTemplateParmPack() const
Retrieve the substituted template template parameter pack, if known.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Represents a C++ template name within the type system.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion, return the pattern as a template name.
Represents a GCC generic vector type.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ClassTemplateDecl * getSpecializedTemplate() const
Retrieve the template that this specialization specializes.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
QualType getElementType() const
RecordDecl * getDefinition() const
getDefinition - Returns the RecordDecl that actually defines this struct/union/class.
QualType getReplacementType() const
Gets the type that was substituted for the template parameter.
const TemplateTypeParmType * getReplacedParameter() const
Gets the template parameter that was substituted for.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
const IdentifierInfo * getIdentifier() const
Encodes a location in the source.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Determines whether this field is a representative for an anonymous struct ...
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
unsigned getBitWidthValue(const ASTContext &Ctx) const
Interfaces are the core concept in Objective-C for object oriented design.
A structure for storing an already-substituted template template parameter pack.
ASTContext & getASTContext() const LLVM_READONLY
static QualType getUnderlyingType(const SubRegion *R)
VectorKind getVectorKind() const
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
const T * castAs() const
Member-template castAs<specific type>.
ObjCProtocolDecl * getProtocol(unsigned I) const
Fetch a protocol by index.
ObjCTypeParamDecl * getDecl() const
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
The injected class name of a C++ class template or class template partial specialization.
Expr * getSizeExpr() const
Base class for declarations which introduce a typedef-name.
bool isAnonymousStructOrUnion() const
isAnonymousStructOrUnion - Whether this is an anonymous struct or union.
Represents a template argument.
QualType getAsType() const
Retrieve the type for a type template argument.
Represents a template name that was expressed as a qualified name.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
bool isParameterPack() const
EnumDecl - Represents an enum.
A pointer to member type per C++ 8.3.3 - Pointers to members.
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool isOverloadedOperator() const
Determine whether this template name refers to an overloaded operator.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
const TemplateArgument & getArg(unsigned Idx) const
QualType getPointeeType() const
Gets the type pointed to by this ObjC pointer.
Represents a pointer to an Objective C object.
llvm::DenseSet< std::pair< Decl *, Decl * > > & NonEquivalentDecls
Declaration (from, to) pairs that are known not to be equivalent (which we have already complained ab...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
unsigned getTypeQuals() const
QualType getIntegralType() const
Retrieve the type of the integral value.
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
Base for LValueReferenceType and RValueReferenceType.
TemplateDecl * getDecl() const
The template declaration that this qualified name refers to.
NestedNameSpecifier * getQualifier() const
const TemplateArgument & getArg(unsigned Idx) const
Retrieve a specific template argument as a type.
Represents a base class of a C++ class.
const TemplateArgumentList & getTemplateArgs() const
Retrieve the template arguments of the class template specialization.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
llvm::DenseMap< Decl *, Decl * > TentativeEquivalences
The set of "tentative" equivalences between two canonical declarations, mapping from a declaration in...
const Type * getClass() const
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
Represents a type parameter type in Objective C.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
Represents a C++ struct/union/class.
Represents a template specialization type whose template cannot be resolved, e.g. ...
ArraySizeModifier getSizeModifier() const
ElaboratedTypeKeyword getKeyword() const
A structure for storing the information associated with an overloaded template name.
std::deque< Decl * > DeclsToCheck
Queue of declarations in the first context whose equivalence with a declaration in the second context...
Declaration of a class template.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
QualType getPointeeTypeAsWritten() const
static Decl::Kind getKind(const Decl *D)
Represents a type template specialization; the template must be a class template, a type alias templa...
QualType getElementType() const
bool Complain
Whether to complain about failures.
SourceLocation getLocation() const
Represents a C array with a specified size that is not an integer-constant-expression.
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Represents the canonical version of C arrays with a specified constant size.
NamedDecl *const * iterator
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
unsigned getNumExceptions() const
SourceLocation getTemplateLoc() const