Clang Project

clang_source_code/test/SemaCXX/function-redecl-2.cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2
3namespace redecl_in_templ {
4template<typename T> void redecl_in_templ() {
5  extern void func_1();  // expected-note  {{previous declaration is here}}
6  extern int  func_1();  // expected-error {{functions that differ only in their return type cannot be overloaded}}
7}
8
9void g();
10constexpr void (*p)() = g;
11
12template<bool> struct X {};
13template<> struct X<true> { typedef int type; };
14
15template<typename T> void f() {
16  extern void g();
17  X<&g == p>::type n;
18}
19}
20