On 09/05/2011 01:04 AM, Gabriel Dos Reis wrote:
On Sun, Sep 4, 2011 at 11:29 PM, Jason Merrill<ja...@redhat.com> wrote:
At the Bloomington C++ meeting we discussed some issues with the constexpr
specification that the clang team encountered while trying to implement it.
Among the issues was a problem that also came up recently for us as BZ
50248: if the constexpr-ness of a template instantiation depends on its
body, we need to instantiate it in order to decide whether or not an
implicitly-declared function that uses it is constexpr. The resolution of
DR 1358 is that an instantiation of a constexpr template is constexpr even
if it can never produce a constant expression.
I am lost: so no diagnostic is issued but the function is deemed constexpr?
For a template instantiation, correct. If the function doesn't satisfy
the constexpr requirements, we don't store it in the hash table and we
complain about it if it's used in a constant expression. We don't want
a function to change constexpr status depending on whether it has been
instantiated or not, so they should just stay constexpr.
Jason