Conditionally-supported behavior for non-POD objects passed to ellipsis redux
Section [expr.call]
Howard Hinnant

Created on 2007-06-06.00:00:00 last changed 161 months ago


Date: 2008-09-15.00:00:00

[Voted into the WP at the September, 2008 meeting.]

Date: 2007-09-15.00:00:00

Proposed resolution (September, 2007):

Change [expr.call] paragraph 7 as follows:

...Passing an a potentially-evaluated argument of non-trivial class type (clause Clause 11 [class]) with no corresponding parameter is conditionally-supported, with implementation-defined semantics...
Date: 2007-07-15.00:00:00

Notes from the July, 2007 meeting:

The CWG agreed with the suggestion to allow such calls in unevaluated contexts.

Date: 2007-08-05.00:00:00

Issue 506 changed passing a non-POD class type to an ellipsis from undefined behavior to conditionally-supported behavior. As a result, an implementation could conceivably reject code like the following:

    struct two {char _[2];};

    template <class From, class To>
    struct is_convertible
            static From f;

            template <class U> static char test(const U&);
            template <class U> static two test(...);
            static const bool value = sizeof(test<To>(f)) == 1;

    struct A

    int main()
         const bool b = is_convertible<A,int>::value;  // b == false

This technique has become popular in template metaprogramming, and no non-POD object is actually passed at runtime. Concepts will eliminate much (perhaps not all) of the need for this kind of programming, but legacy code will persist.

Perhaps this technique should be officially supported by allowing implementations to reject passing a non-POD type to ellipsis only if it appears in a potentially-evaluated expression?

Date User Action Args
2008-10-05 00:00:00adminsetmessages: + msg1809
2008-10-05 00:00:00adminsetstatus: ready -> cd1
2008-06-29 00:00:00adminsetstatus: review -> ready
2008-05-18 00:00:00adminsetmessages: + msg1651
2008-05-18 00:00:00adminsetstatus: drafting -> review
2007-08-05 00:00:00adminsetmessages: + msg1519
2007-08-05 00:00:00adminsetstatus: open -> drafting
2007-06-06 00:00:00admincreate