temp_arg_nontype_cxx11.cpp revision c0cedbe537e4b25eeb8d61d0c30a2ac31a7fddab
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2
3namespace PR15360 {
4  template<typename R, typename U, R F>
5  U f() { return &F; } // expected-error{{cannot take the address of an rvalue of type 'int (*)(int)'}} expected-error{{cannot take the address of an rvalue of type 'int *'}}
6  void test() {
7    f<int(int), int(*)(int), nullptr>(); // expected-note{{in instantiation of}}
8    f<int[3], int*, nullptr>(); // expected-note{{in instantiation of}}
9  }
10}
11