diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -3827,7 +3827,7 @@ /// DecompositionDecl of type 'int (&)[3]'. class BindingDecl : public ValueDecl { /// The declaration that this binding binds to part of. - LazyDeclPtr Decomp; + ValueDecl *Decomp; /// The binding represented by this declaration. References to this /// declaration are effectively equivalent to this expression (except /// that it is only evaluated once at the point of declaration of the @@ -3853,7 +3853,7 @@ /// Get the decomposition declaration that this binding represents a /// decomposition of. - ValueDecl *getDecomposedDecl() const; + ValueDecl *getDecomposedDecl() const { return Decomp; } /// Get the variable (if any) that holds the value of evaluating the binding. /// Only present for user-defined bindings for tuple-like types. diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -3179,12 +3179,6 @@ return new (C, ID) BindingDecl(nullptr, SourceLocation(), nullptr); } -ValueDecl *BindingDecl::getDecomposedDecl() const { - ExternalASTSource *Source = - Decomp.isOffset() ? getASTContext().getExternalSource() : nullptr; - return cast_or_null(Decomp.get(Source)); -} - VarDecl *BindingDecl::getHoldingVar() const { Expr *B = getBinding(); if (!B)