xref: /minix3/external/bsd/llvm/dist/clang/test/SemaTemplate/dependent-class-member-operator.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc // PR7837
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc template<class T> struct C1 { void operator()(T); };
5*f4a2713aSLionel Sambuc template<class T> struct C2; // expected-note {{template is declared here}}
6*f4a2713aSLionel Sambuc template<class T> void foo(T);
wrap()7*f4a2713aSLionel Sambuc void wrap() {
8*f4a2713aSLionel Sambuc   foo(&C1<int>::operator());
9*f4a2713aSLionel Sambuc   foo(&C1<int>::operator+); // expected-error {{no member named 'operator+' in 'C1<int>'}}
10*f4a2713aSLionel Sambuc   foo(&C2<int>::operator+); // expected-error {{implicit instantiation of undefined template 'C2<int>'}}
11*f4a2713aSLionel Sambuc }
12