Created on 2002-12-12.00:00:00 last changed 95 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 9.3.4.6 [dcl.fct] paragraph 8 as follows, including deleting the footnote:
If the type of a parameter includes a type of the form “pointer to array of unknown bound of T” or “reference to array of unknown bound of T,” the program is ill-formed.101Functions shall not have a return type of type array or function, although...
Additional note (January, 2013):
Additional discussion of this issue has arisen . For example, the following is permissible:
T (*p) [] = (U(*)[])0;
but the following is not:
template<class T> void sp_assert_convertible( T* ) {} sp_assert_convertible<T[]>( (U(*)[])0 );
Notes from April 2003 meeting:
We agreed that the example should be allowed.
EDG rejects this code:
template <typename T> struct S {}; void f (S<int (*)[]>);G++ accepts it.
This is another case where the standard isn't very clear:
The language from 9.3.4.6 [dcl.fct] is:
If the type of a parameter includes a type of the form "pointer to array of unknown bound of T" or "reference to array of unknown bound of T," the program is ill-formed.Since "includes a type" is not a term defined in the standard, we're left to guess what this means. (It would be better if this were a recursive definition, the way a type theoretician would do it:
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5374 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4828 |
2014-03-03 00:00:00 | admin | set | status: open -> ready |
2013-09-03 00:00:00 | admin | set | status: drafting -> open |
2013-01-14 00:00:00 | admin | set | messages: + msg4210 |
2003-04-25 00:00:00 | admin | set | messages: + msg839 |
2003-04-25 00:00:00 | admin | set | status: open -> drafting |
2002-12-12 00:00:00 | admin | create |