================
Comment at: lib/Sema/SemaOpenMP.cpp:2592
@@ -2591,3 +2591,3 @@
   Expr *ValExpr = NumThreads;
   if (!NumThreads->isValueDependent() && !NumThreads->isTypeDependent() &&
       !NumThreads->isInstantiationDependent() &&
----------------
ABataev wrote:
> hfinkel wrote:
> > ABataev wrote:
> > > hfinkel wrote:
> > > > Do you need all of these checks, or is value-dependent enough?
> > > I think we need all of them, because num_threads argument is not a 
> > > constant, but an expression.
> > I'm not sure; I think this is worth testing. A similar issue same up with 
> > the patches for the assume_aligned attribute, and it turned out that only 
> > the ValueDependent check was needed. Note that sizeof(T), for example, is 
> > value-dependent, not type-dependent.
> Here are some excerpts from the header:
> /// template<int Size, char (&Chars)[Size]> struct meta_string - value depend 
> bound of Chars
> /// template<typename T> void add(T x) { return x;} - x is type dependent - 
> it can be used as num_threads(x)
> /// template<typename T> void add() { return sizeof(sizeof(T()));} - return 
> is instantiation-dependent - I think this check can be excluded
> /// template<typename F, typename ...Types> void forward(const F &f, Types 
> &&...args) { f(static_cast<Types&&>(args)...); } - call to f contains 
> unexpanded parameter pack - num_threads(f(static_cast<Types&&>(args)...))
> 
Ah, you're right. num_threads is not necessarily a compile-time constant, so 
the situation is different.

http://reviews.llvm.org/D5145



_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to