[PATCH] D134702: [Clang] Don't warn if deferencing void pointers in unevaluated context

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 10:47:37 PDT 2022


nickdesaulniers added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:14539
     LangOptions LO = S.getLangOpts();
-    if (LO.CPlusPlus || !(LO.C99 && IsAfterAmp))
+    if (LO.CPlusPlus || !(LO.C99 && (IsAfterAmp || S.isUnevaluatedContext())))
       S.Diag(OpLoc, diag::ext_typecheck_indirection_through_void_pointer)
----------------
nickdesaulniers wrote:
> Sorry, I should have asked more about this subexpresssion.
> 
> Our CI is still red for older branches of the Linux kernel ("stable" branches) because the kernel only recently started using `-std=gnu11` from `-std=gnu89`.
> 
> Why is this considered an error for `-std=gnu89`?
https://reviews.llvm.org/D135090


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134702



More information about the cfe-commits mailing list