ArcsinX added inline comments.

================
Comment at: clang/lib/Sema/SemaChecking.cpp:5779
         QualType ParamTy = Proto->getParamType(ArgIdx);
+        if (ParamTy->containsErrors())
+          continue;
----------------
hokein wrote:
> It looks like for the failure case the `ParamTy` for the parameter is a 
> dependent array type, and it violates the "non-dependent" assumption of 
> `clang::ASTContext::getTypeInfoImpl` which is called by  
> `getTypeAlignInChars` in `CheckArgAlignment`.
> 
> so I'd suggest moving the fix to `CheckArgAlignment` line 5685 (adding a 
> `ParamTy->isDependentType()` to the `if` condition).
When I found this problem I fixed it like you are suggesting. But after that I 
replaced it with this check, because it seems there is no reason to try to 
check something on code with errors.

I mean that even if we are not crashing, results from `CheckArgAlignment()` 
can't be trusted if we are passing  something with errors to it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133886

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

Reply via email to