This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCHes for core 1358, 1360, c++/50248 (constexpr, templates, default constructor)


On 09/05/2011 01:04 AM, Gabriel Dos Reis wrote:
On Sun, Sep 4, 2011 at 11:29 PM, Jason Merrill<jason@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]