[PATCH] D61458: [hip] Relax CUDA call restriction within `decltype` context.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 14:27:24 PDT 2019


tra added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:10407-10409
   bool IsAllowedCUDACall(const FunctionDecl *Caller,
                          const FunctionDecl *Callee) {
+    if (llvm::any_of(ExprEvalContexts,
----------------
One more thing. The idea of this function is that we're checking if the `Caller` is allowed to call the `Callee`.
However here, you're checking the current context, which may not necessarily be the same as the caller's. I.e. someone could potentially call it way after the context is gone.

Currently all uses of this function obtain the caller from `CurContext`, but if we start relying on other properties of the current context other than the caller function, then we may neet to pass the context explicitly, or only pass the Callee and check if it's callable from the current context.

```



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61458





More information about the cfe-commits mailing list