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

2024-12-19


1245. Matching declarations involving decltype

Section: 13.7.2.2  [temp.mem.func]     Status: C++11     Submitter: Jason Merrill     Date: 2011-02-22

Type matching rules aren't well-specified in the current Standard, but it seems reasonable to say that if a declaration uses decltype, its definition must do so as well. For example, the following should be ill-formed:

    template<class T, T* u> struct S {
      decltype(u) foo(T);
    };

    template<class T, T *u> T* S<T, u>::foo(T) {
       return nullptr;
    }

Proposed resolution (March, 2011):

This issue is resolved by the resolution of issue 1057 in document N3262.