llvm-capstone/clang/test/SemaCXX/template-ambiguous-overload.cpp
Saleem Abdulrasool 78704fb6dc Sema: print qualified name for overload candidates
Print the fully qualified names for the overload candidates.  This makes
it easier to tell what the ambiguity is.  Especially if a template
is instantiated after a using namespace, it will not inherit the
namespace where it was declared.  The specialization will give a message
about a partial order being ambiguous for the same (unqualified) name,
which does not help identify the failure.

Addresses PR31450!

llvm-svn: 290315
2016-12-22 04:26:57 +00:00

17 lines
470 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
namespace n {
template <int>
void f(); // expected-note{{explicit instantiation candidate function 'n::f<0>' template here [with $0 = 0]}}
extern template void f<0>();
}
using namespace n;
template <int>
void f() {} // expected-note{{explicit instantiation candidate function 'f<0>' template here [with $0 = 0]}}
template void f<0>(); // expected-error{{partial ordering for explicit instantiation of 'f' is ambiguous}}