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

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 3 05:50:40 PDT 2019


hliao marked an inline comment as done.
hliao 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,
----------------
tra wrote:
> 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.
> 
> ```
> 
as the expression within `decltype` may be quite complicated, the idea here is to relax that rule within `decltype` context, not only for a particular pair of caller/callee.


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