view gcc/testsuite/g++.old-deja/g++.pt/spec20.C @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do assemble  }

// According to the non-normative example in
// [temp.class.spec.mfunc]/2, these should be valid, but the grammar
// in the Standard does not allow partial nor full specializations as
// member-declarations, so we'd better not support them.

template <class T> 
struct S {
  template <class U> void f(U);
  template <> void f<int>(int); // { dg-error "20:template-id .f<int>. in declaration|explicit specialization" }

  template <class V> struct I {};      // { dg-error "template" }
  template <class V> struct I<V*> {};  // { dg-error "template" }
  template <> struct I<int>; // { dg-error "" } invalid specialization
};