[PATCH] D105380: [clang] fixes named return of variables with dependent alignment

Matheus Izvekov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 5 14:40:35 PDT 2021


mizvekov added a comment.

In D105380#2858638 <https://reviews.llvm.org/D105380#2858638>, @aaronpuchert wrote:

> I tend to follow the rule that if it's just used once I keep it local, but you might have good reasons for making it public.

Well it is used twice.
Notice how I replaced a pre-existing static function called `hasDependentAlignment` with a static class member with the same name.
Since I kept the name, and it was used from a Sema member function, I did not have to change the code in the call site, hence it did not show up in the diff :)



================
Comment at: clang/lib/Sema/SemaDecl.cpp:13316
+  return VD->getType()->isDependentType() ||
+         std::any_of(range.begin(), range.end(), [](const AlignedAttr *AA) {
+           return AA->isAlignmentDependent();
----------------
aaronpuchert wrote:
> From `llvm/include/llvm/ADT/STLExtras.h`.
That looks much better, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105380



More information about the cfe-commits mailing list