[PATCH] D62975: Require stdcall etc parameters to be complete on ODR use

Bob Haarman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 6 13:20:42 PDT 2019


inglorion added a comment.

Can you clarify "which will usually result in a linker error"? E.g. an example of link.exe rejecting the object file or the wrong function being called. The reason I ask is that if we can be sure at compile time that the resulting code will not work or do the wrong thing, I think giving an error is appropriate. But if that isn't the case, we would be rejecting code that cl.exe accepts and we might want to make it a Warning instead.



================
Comment at: clang/lib/Sema/SemaExpr.cpp:14801
+  const llvm::Triple &TT = S.Context.getTargetInfo().getTriple();
+  if (!TT.isOSWindows() || (TT.getArch() != llvm::Triple::x86 &&
+                            TT.getArch() != llvm::Triple::x86_64))
----------------
Do we need those checks or would it be enough to just check the calling convention?

Also, I think s/Do nothing/return false/


================
Comment at: clang/lib/Sema/SemaExpr.cpp:14813
+  default:
+    break;
+  }
----------------
You can just return false here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62975





More information about the cfe-commits mailing list