Title
Accessibility and function signatures
Status
nad
Section
13.10.3 [temp.deduct]
Submitter
Jason Merrill

Created on 2011-03-24.00:00:00 last changed 140 months ago

Messages

Date: 2011-08-15.00:00:00

Rationale (August, 2011):

The specification is as intended. To the extent that there is an issue here, it is covered by issue 1172.

Date: 2022-11-20.07:54:16

With the resolution of issue 1170, which takes access into account in template argument deduction, it is now possible to have instantiation-dependent expressions (see issue 1172) that do not directly involve a template parameter. For example:

  template <class T> struct C;

  class A
  {
    int i;
    friend struct C<int>;
  } a;

  class B
  {
    int i;
    friend struct C<float>;
  } b;

  template <class T>
  struct C
  {
    template <class U> decltype (a.i) f() { } // #1
    template <class U> decltype (b.i) f() { } // #2
  };

  int main()
  {
    C<int>().f<int>();   // calls #1
    C<float>().f<float>(); // calls #2
  }
History
Date User Action Args
2012-09-24 00:00:00adminsetmessages: + msg4029
2011-03-24 00:00:00admincreate