This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
Section: 126.96.36.199 [constexpr.functions] Status: C++14 Submitter: Matt Austern Opened: 2010-11-12 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [constexpr.functions].
View all issues with C++14 status.
Suppose that a particular function is not tagged as constexpr in the standard, but that, in some particular implementation, it is possible to write it within the constexpr constraints. If an implementer tags such a function as constexpr, is that a violation of the standard or is it a conforming extension?
There are two questions to consider. First, is this allowed under the as-if rule? Second, if it does not fall under as-if, is there (and should there be) any special license granted to implementers to do this anyway, sort of the way we allow elision of copy constructors even though it is detectable by users?
I believe that this does not fall under "as-if", so implementers probably don't have that freedom today. I suggest changing the WP to grant it. Even if we decide otherwise, however, I suggest that we make it explicit.
[ 2011 Bloomington ]
General surprise this was not already in 'Ready' status, and so moved.
[ 2012 Kona ]
Some concern expressed when presented to full committee for the vote to WP status that this issue had been resolved without sufficient thought of the consequences for diverging library implementations, as users may use SFINAE to observe different behavior from otherwise identical code. Issue moved back to Review status, and will be discussed again in Portland with a larger group. Note for Portland: John Spicer has agreed to represent Core's concerns during any such discussion within LWG.
Straw poll: LWG strongly favoured to remove from implementations the freedom to add constexpr.
Matt provides new wording.
Move to Immediate after reviewing Matt's new wording, apply the new wording to the Working Paper.
In 188.8.131.52 [constexpr.functions], change paragraph 1 to:
Within any header that provides any non-defining declarations of constexpr functions or constructors an implementation shall provide corresponding definitions.