This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


1476. Definition of user-defined type

Section: Clause 3  [intro.defs]     Status: CD3     Submitter: Loïc Joly     Date: 2012-03-08

[Moved to DR at the April, 2013 meeting.]

The Standard uses the phrase, “user-defined type,” but it is not clear what it is intended to mean. For example, 16.4.5.2.1 [namespace.std] paragraph 1 says,

A program may add a template specialization for any standard library template to namespace std only if the declaration depends on a user-defined type...

Are types defined in the Standard library “user-defined?”

9.2.9.3 [dcl.type.simple] paragraph 2 says,

The auto specifier is a placeholder for a type to be deduced (9.2.9.7 [dcl.spec.auto]). The other simple-type-specifiers specify either a previously-declared user-defined type or one of the fundamental types (6.8.2 [basic.fundamental]).

implying that all non-fundamental types are “user-defined.”

A definition is needed, as well as a survey of uses of the term to ensure consistency with the definition.

Proposed resolution (October, 2012):

  1. Change 9.2.9.3 [dcl.type.simple] paragraph 2 as follows:

  2. The auto specifier is a placeholder for a type to be deduced (9.2.9.7 [dcl.spec.auto]). The other simple-type-specifiers specify either a previously-declared user-defined type, a type determined from an expression, or one of the fundamental types (6.8.2 [basic.fundamental]). Table 10 summarizes the valid combinations of simple-type-specifiers and the types they specify.
  3. Change 7.3 [conv] paragraph 4 as follows:

  4. [Note: For user-defined class types, user-defined conversions are considered as well; see 11.4.8 [class.conv]. In general, an implicit conversion sequence (12.2.4.2 [over.best.ics]) consists of a standard conversion sequence followed by a user-defined conversion followed by another standard conversion sequence. —end note]

  5. Change the example in 12.2.2.3 [over.match.oper] paragraph 1 as follows:

  6.   ...
      void f(void) {
        const char* p= "one" + "two";  // ill-formed because neither
                                       // operand has user-defined class or enumeration type
        int I = 1 + 1;                 // Always evaluates to 2 even if
                                       // user-defined class or enumeration types exist which
                                       // would perform the operation.
      }