erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.

LGTM, thanks!



================
Comment at: clang/lib/AST/DeclBase.cpp:1037
+  assert(getDeclContext());
+  return getDeclContext()->getNonTransparentContext();
+}
----------------
erichkeane wrote:
> so why are we calling this on our `DeclContext` here, which is the 'parent' 
> of the current `Decl`?  Shouldn't this be casting itself to `DeclContext` and 
> calling this function on it, so we don't end up 'skipping' the first parent?
Ah, I see... `getNonTransparentContext` works differently from the other 
`getDeclContext` type functions in that it does NOT get the 1st parent, it will 
return the 'current' `DeclContext` if necessary.  So casting it would be 
incorrect here. Strange that this works opposite of the rest, but looks like 
you're right :) 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131651/new/

https://reviews.llvm.org/D131651

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to