efriedma added a comment.

> In the case is explicit instantiation there is apparent connection
> between a point in source code and instantiated function. It can
> support interaction of pragmas that act in that point. For example, in
> the code:
>
>   #pragma STDC FENV_ROUND FE_DOWNWARD
>   template float func_05<short>(float, float);
>
> the instantiated function is created with the specified constant
> rounding mode. The effect is same as if the template pattern were
> textually inserted into the code with needed replacements.

These pragmas aren't currently part of the C++ standard, but I strongly doubt 
the C++ standards committee would choose to do this.  You would end up with 
undefined behavior due to mismatched definitions, if the template is implicitly 
instantiated elsewhere.

The "obvious" rule here is just to always use the pragma in effect at the point 
the template body is written.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131143

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

Reply via email to