jdoerfert added inline comments.

================
Comment at: clang/include/clang/Sema/Sema.h:10333
+  /// Check if there is an active global `omp begin assumes` directive.
+  bool isInOpenMPAssumeScope() { return !OMPAssumeScoped.empty(); }
+
----------------
ABataev wrote:
> jdoerfert wrote:
> > ABataev wrote:
> > > ABataev wrote:
> > > > `const` member functions.
> > > It may have side-effects with template instantiations. What if we have 
> > > something like this:
> > > ```
> > > #pragma omp begin assumes ...
> > > template <typename T>
> > > struct S {
> > > ...
> > > }
> > > #pragma omp end assumes
> > > 
> > > void bar() {
> > > #pragma omp assumes ...
> > >   {
> > >     S<int> s;
> > >     s.foo();
> > >   }
> > > }
> > > ```
> > > ?
> > > 
> > > `struct S<int>` will be instantiated in the second assume region context 
> > > though I doubt this is the user intention.
> > I'm not sure what problem you expect here. Could you elaborate what you 
> > think should happen or should not?
> May it lead to the wrong compiler assumptions and result in the incorrect 
> codegen?
I'm still not following your example. What wrong assumptions and/or incorrect 
code generation do you expect? Could you provide an example with actual 
assumptions and then describe what the problem is please.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91980

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to