static bool classof(const OpaqueValueExpr *) { return true; }
};
-/// \brief Represents the qualifier that may precede a C++ name, e.g., the
-/// "std::" in "std::sort".
-struct NameQualifier {
- /// \brief The nested-name-specifier that qualifies the name, including
- /// source-location information.
- NestedNameSpecifierLoc QualifierLoc;
-};
-
/// \brief Represents an explicit template argument list in C++, e.g.,
/// the "<int>" in "sort<int>".
struct ExplicitTemplateArgumentList {
/// embedded in D.
DeclarationNameLoc DNLoc;
- /// \brief Helper to retrieve the optional NameQualifier.
- NameQualifier &getNameQualifier() {
+ /// \brief Helper to retrieve the optional NestedNameSpecifierLoc.
+ NestedNameSpecifierLoc &getInternalQualifierLoc() {
assert(hasQualifier());
- return *reinterpret_cast<NameQualifier *>(this + 1);
+ return *reinterpret_cast<NestedNameSpecifierLoc *>(this + 1);
}
- /// \brief Helper to retrieve the optional NameQualifier.
- const NameQualifier &getNameQualifier() const {
- return const_cast<DeclRefExpr *>(this)->getNameQualifier();
+ /// \brief Helper to retrieve the optional NestedNameSpecifierLoc.
+ const NestedNameSpecifierLoc &getInternalQualifierLoc() const {
+ return const_cast<DeclRefExpr *>(this)->getInternalQualifierLoc();
}
DeclRefExpr(NestedNameSpecifierLoc QualifierLoc,
if (!hasQualifier())
return 0;
- return getNameQualifier().QualifierLoc.getNestedNameSpecifier();
+ return getInternalQualifierLoc().getNestedNameSpecifier();
}
/// \brief If the name was qualified, retrieves the nested-name-specifier
if (!hasQualifier())
return NestedNameSpecifierLoc();
- return getNameQualifier().QualifierLoc;
+ return getInternalQualifierLoc();
}
/// \brief Determines whether this declaration reference was followed by an
return *reinterpret_cast<ExplicitTemplateArgumentList *>(this + 1);
return *reinterpret_cast<ExplicitTemplateArgumentList *>(
- &getNameQualifier() + 1);
+ &getInternalQualifierLoc() + 1);
}
/// \brief Retrieve the explicit template argument list that followed the
///
class MemberExpr : public Expr {
/// Extra data stored in some member expressions.
- struct MemberNameQualifier : public NameQualifier {
+ struct MemberNameQualifier {
+ /// \brief The nested-name-specifier that qualifies the name, including
+ /// source-location information.
+ NestedNameSpecifierLoc QualifierLoc;
+
+ /// \brief The DeclAccessPair through which the MemberDecl was found due to
+ /// name qualifiers.
DeclAccessPair FoundDecl;
};
D(D), Loc(NameLoc) {
DeclRefExprBits.HasQualifier = QualifierLoc ? 1 : 0;
if (QualifierLoc)
- getNameQualifier().QualifierLoc = QualifierLoc;
+ getInternalQualifierLoc() = QualifierLoc;
DeclRefExprBits.HasExplicitTemplateArgs = TemplateArgs ? 1 : 0;
if (TemplateArgs) {
D(D), Loc(NameInfo.getLoc()), DNLoc(NameInfo.getInfo()) {
DeclRefExprBits.HasQualifier = QualifierLoc ? 1 : 0;
if (QualifierLoc)
- getNameQualifier().QualifierLoc = QualifierLoc;
+ getInternalQualifierLoc() = QualifierLoc;
DeclRefExprBits.HasExplicitTemplateArgs = TemplateArgs ? 1 : 0;
if (TemplateArgs)
const TemplateArgumentListInfo *TemplateArgs) {
std::size_t Size = sizeof(DeclRefExpr);
if (QualifierLoc != 0)
- Size += sizeof(NameQualifier);
+ Size += sizeof(NestedNameSpecifierLoc);
if (TemplateArgs)
Size += ExplicitTemplateArgumentList::sizeFor(*TemplateArgs);
unsigned NumTemplateArgs) {
std::size_t Size = sizeof(DeclRefExpr);
if (HasQualifier)
- Size += sizeof(NameQualifier);
+ Size += sizeof(NestedNameSpecifierLoc);
if (HasExplicitTemplateArgs)
Size += ExplicitTemplateArgumentList::sizeFor(NumTemplateArgs);