================
@@ -1428,6 +1428,17 @@ bool DeclContext::Encloses(const DeclContext *DC) const {
   return false;
 }
 
+bool DeclContext::LexicallyEncloses(const DeclContext *DC) const {
+  if (getPrimaryContext() != this)
+    return getPrimaryContext()->LexicallyEncloses(DC);
+
+  for (; DC; DC = DC->getLexicalParent())
+    if (!isa<LinkageSpecDecl>(DC) && !isa<ExportDecl>(DC) &&
----------------
AaronBallman wrote:

This code was lifted from `DeclContext::Encloses()`, so the cleanup is easy 
because it doesn't change logic between the two functions. I'll clean that up, 
but other changes should be done in a follow-up so they're done consistently 
(if done at all). WDYT?

https://github.com/llvm/llvm-project/pull/137368
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to