Title
Function parameter transformations and template functions
Status
dup
Section
9.3.4.6 [dcl.fct]
Submitter
Jason Merrill

Created on 2009-11-08.00:00:00 last changed 173 months ago

Messages

Date: 2010-08-15.00:00:00

Rationale (August, 2010):

This is a duplicate of issue 1001.

Date: 2022-11-20.07:54:16

9.3.4.6 [dcl.fct] paragraph 5 specifies that cv-qualifiers are deleted from parameter types. However, it's not clear what this should mean for function templates. For example,

    template<class T> struct A {
       typedef A arr[3];
    };

    template<class T> void f(const typename A<T>::arr) { }

    template void f<int>(const A<int>::arr); // #1

    template <class T> struct B {
       void g(T);
    };

    template <class T> void B<T>::g(const T) { } // #2

If cv-qualifiers are dropped, then the explicit instantiation in #1 will fail to match; if cv-qualifiers are retained, then the definition in #2 does not match the declaration.

History
Date User Action Args
2010-08-23 00:00:00adminsetmessages: + msg2959
2010-08-23 00:00:00adminsetstatus: open -> dup
2009-11-08 00:00:00admincreate