[Clang][OpenMP] Only check value if the expression is not instantiation dependent
Currently the following case fails: ``` template<typename Ty> Ty foo(Ty *addr, Ty val) { Ty v; #pragma omp atomic compare capture { v = *addr; if (*addr > val) *addr = val; } return v; } ``` The compiler complains `addr` is not a lvalue. That's because when an expression is instantiation dependent, we cannot tell if it is lvalue or not. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D135224
Loading
Please sign in to comment