[PATCH] D36353: Instantiate constexpr function when it is used

2017-08-06 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 109928. sepavloff added a comment. Updated patch I missed CWG issue 1581. It make patch description invalid, but the patch itself can be repaired with small modification. This fix originated from the attempt to solve the problem described in http://lists.l

[PATCH] D36353: Instantiate constexpr function when it is used

2017-08-05 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith requested changes to this revision. rsmith added a comment. This revision now requires changes to proceed. The current behaviour is correct according to the latest discussions of CWG. We shouldn't be delaying instantiation; we just need to fix the recent regression for functions where we

[PATCH] D36353: Instantiate constexpr function when it is used

2017-08-05 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Previous behavior was to instantiate constexpr function always, even if it is used in the body of a template. For instance, in the following code: template constexpr T foo(T x) { return x; } template T bar(T x) { return foo(0); } the function template special