Ambiguous partial specializations of member class templates
_N4868_.13.7.6 [temp.class.spec]
Doug Gregor

Created on 2009-10-28.00:00:00 last changed 96 months ago


Date: 2011-03-15.00:00:00

[Voted into the WP at the March, 2011 meeting as part of paper N3262.]

Date: 2010-11-15.00:00:00

Notes from the November, 2010 meeting:

The instantiation of Outer<int,int> results in duplicate declarations of the partial specialization, which are ill-formed by 11.4 [class.mem] paragraph 1. No normative change is required, but it might be helpful to add an example like this somewhere.

Date: 2021-02-24.00:00:00

Given an example like

  template<typename T, typename U>
  struct Outer {
    template<typename X, typename Y> struct Inner;
    template<typename Y> struct Inner<T, Y> {};
    template<typename Y> struct Inner<U, Y> {};
  Outer<int, int> outer;                      // #1
  Outer<int, int>::Inner<int, float> inner;   // #2

Is #1 ill-formed because of the identical partial specializations? If not, presumably #2 is ill-formed because of the resulting ambiguity (_N4868_. [temp.class.spec.match] paragraph 1).

Date User Action Args
2014-03-03 00:00:00adminsetstatus: fdis -> c++11
2011-04-10 00:00:00adminsetmessages: + msg3387
2011-04-10 00:00:00adminsetstatus: drafting -> fdis
2010-11-29 00:00:00adminsetmessages: + msg3126
2010-11-29 00:00:00adminsetstatus: open -> drafting
2009-10-28 00:00:00admincreate