summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/member-specialization.cpp
blob: ea30a7a0cd749881208b3c544a985766bac84fea (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %clang_cc1 -std=c++17 -verify %s
// expected-no-diagnostics

template<typename T, typename U> struct X {
  template<typename V> const V &as() { return V::error; }
  template<> const U &as<U>() { return u; }
  U u;
};
int f(X<int, int> x) {
  return x.as<int>();
}