summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/virtual-member-functions.cpp
blob: 69ae0807b4c5b510edd08d0b8329d134b7a406ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -fsyntax-only -verify %s

namespace PR5557 {
template <class T> struct A {
  A();
  virtual int a(T x);
};
template<class T> A<T>::A() {}
template<class T> int A<T>::a(T x) { 
  return *x; // expected-error{{requires pointer operand}}
}

A<int> x; // expected-note{{instantiation}}

template<typename T>
struct X {
  virtual void f();
};

template<>
void X<int>::f() { }
}