C++ ABI: name mangling of operator new [bug 6057]

Richard Smith richard@ex-parrot.com
Thu Jul 26 22:25:00 GMT 2007


Doug Gregor wrote:

> Now, we're saying that any expressions are valid in
> sizeof, decltype, and constant expressions. If those
> expressions fail to type-check during substitution, it
> will be a SFINAE case.

Just to be sure we're not talking at cross purposes, can I
check that the current thinking on DR 339 is that type
traits such as the following should be legal (and do the
obvious thing):

  template <class T>
  class is_default_constructible {
    template <int> struct helper {};
    typedef char no; typedef char yes[2];
    static no fn(...);
    static yes fn( helper<sizeof(new T)>* );
  public:
    static const bool value = sizeof(fn(0)) == sizeof(yes);
  };

If so, that's excellent news.

Richard Smith



More information about the Gcc mailing list