}
if (isFunctionTemplateSpecialization) {
- if (CheckFunctionTemplateSpecialization(NewFD,
- (HasExplicitTemplateArgs ? &TemplateArgs : 0),
- Previous))
- NewFD->setInvalidDecl();
+ if (isFriend && NewFD->getType()->isDependentType()) {
+ // FIXME: When we see a friend of a function template
+ // specialization with a dependent type, we can't match it now;
+ // for now, we just drop it, until we have a reasonable way to
+ // represent the parsed-but-not-matched friend function template
+ // specialization in the AST.
+ return 0;
+ } else if (CheckFunctionTemplateSpecialization(NewFD,
+ (HasExplicitTemplateArgs ? &TemplateArgs : 0),
+ Previous))
+ NewFD->setInvalidDecl();
} else if (isExplicitSpecialization && isa<CXXMethodDecl>(NewFD) &&
CheckMemberSpecialization(NewFD, Previous))
NewFD->setInvalidDecl();
// RUN: %clang_cc1 -faccess-control -verify -emit-llvm-only %s
-
template <typename T> struct Num {
T value_;
template class User<int>; // expected-note {{requested here}}
}
+
+namespace Dependent {
+ template<typename T, typename Traits> class X;
+ template<typename T, typename Traits>
+ X<T, Traits> operator+(const X<T, Traits>&, const T*);
+
+ template<typename T, typename Traits> class X {
+ typedef typename Traits::value_type value_type;
+ friend X operator+<>(const X&, const value_type*);
+ };
+}