[PATCH] D151753: [Clang][Sema] Do not try to analyze dependent alignment during -Wcast-align

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 6 13:00:06 PDT 2023


serge-sans-paille added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:16163
+        // Dependent alignment cannot be resolved -> bail out.
+        if (any_of(VD->specific_attrs<AlignedAttr>(),
+                   [](auto *A) { return A->isAlignmentDependent(); }))
----------------
shafik wrote:
> Can't we just use `hasDependentAlignment()` which basically does this.
> 
> I am curious that we don't have to do this check in every location we use `getDeclAlign`
I missed that method, thanks for point it out. I think we should be doing that check in the other reference in SemaChecking.cpp, but I failed to find a reproducer...


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

https://reviews.llvm.org/D151753



More information about the cfe-commits mailing list