diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index bf38b2e5d537d..9fe4803ce98ec 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -6591,10 +6591,6 @@ bool Compiler::visitDeclRef(const ValueDecl *D, const Expr *E) { return T->isReferenceType(); }; - // DecompositionDecls are just proxies for us. - if (isa(VD)) - return revisit(VD); - if ((VD->hasGlobalStorage() || VD->isStaticDataMember()) && typeShouldBeVisited(VD->getType())) { if (const Expr *Init = VD->getAnyInitializer(); diff --git a/clang/test/AST/ByteCode/cxx17.cpp b/clang/test/AST/ByteCode/cxx17.cpp index 08a40e0a92862..0cf3a4f666d63 100644 --- a/clang/test/AST/ByteCode/cxx17.cpp +++ b/clang/test/AST/ByteCode/cxx17.cpp @@ -141,3 +141,11 @@ template constexpr auto c() { } auto y = c<1>(); // both-note {{in instantiation of function template specialization 'c<1>' requested here}} + +namespace NonConstexprStructuredBinding { + void f1() { + int arr[2] = {}; + auto [a, b] = arr; + static_assert(&a != &b); + } +}