[PATCH] D72996: [Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 10:23:52 PST 2020


lebedev.ri added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:4479
+    const Expr *Arg = Args[AA->getParamIndex().getASTIndex()];
+    if (!Arg->isTypeDependent() && !Arg->isValueDependent()) {
+      llvm::APSInt I(64);
----------------
lebedev.ri wrote:
> erichkeane wrote:
> > Does this need to be isInstantionDependent?
> I'm not sure, should it be?
> It seems there is no such check in `Sema::SemaBuiltinAssumeAligned()`.
As disscussed in IRC, that's https://clang.llvm.org/doxygen/classclang_1_1Expr.html#a954398acd24dedcfc181659f0b906228 `clang::Expr::isInstantiationDependent()`, i think this is consistent with other places,
and *might* be correct. Or other places are incorrect too.
It isn't obvious to me how to produce a testcase, so this might be better left as-is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72996





More information about the cfe-commits mailing list