Skip to content

Commit 26709e4

Browse files
committed
--- Merging r127373 into '.':
U test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp U include/clang/Basic/DiagnosticSemaKinds.td U lib/Sema/SemaDecl.cpp llvm-svn: 127751
1 parent 8b05d47 commit 26709e4

File tree

3 files changed

+3
-22
lines changed

3 files changed

+3
-22
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,8 +1723,6 @@ def err_template_spec_default_arg : Error<
17231723
def err_not_class_template_specialization : Error<
17241724
"cannot specialize a %select{dependent template|template template "
17251725
"parameter}0">;
1726-
def err_function_specialization_in_class : Error<
1727-
"cannot specialize a function %0 within class scope">;
17281726

17291727
// C++ class template specializations and out-of-line definitions
17301728
def err_template_spec_needs_header : Error<

clang/lib/Sema/SemaDecl.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,14 +4067,9 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
40674067
Previous))
40684068
NewFD->setInvalidDecl();
40694069
} else if (isFunctionTemplateSpecialization) {
4070-
if (CurContext->isDependentContext() && CurContext->isRecord()) {
4071-
Diag(NewFD->getLocation(), diag::err_function_specialization_in_class)
4072-
<< NewFD->getDeclName();
4073-
NewFD->setInvalidDecl();
4074-
return 0;
4075-
} else if (CheckFunctionTemplateSpecialization(NewFD,
4076-
(HasExplicitTemplateArgs ? &TemplateArgs : 0),
4077-
Previous))
4070+
if (CheckFunctionTemplateSpecialization(NewFD,
4071+
(HasExplicitTemplateArgs ? &TemplateArgs : 0),
4072+
Previous))
40784073
NewFD->setInvalidDecl();
40794074
} else if (isExplicitSpecialization && isa<CXXMethodDecl>(NewFD)) {
40804075
if (CheckMemberSpecialization(NewFD, Previous))

clang/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,3 @@ void test_func_template(N0::X0<void *> xvp, void *vp, const void *cvp,
237237
xvp.ft1(vp, i);
238238
xvp.ft1(vp, u);
239239
}
240-
241-
namespace PR8979 {
242-
template<typename Z>
243-
struct X0 {
244-
template <class T, class U> class Inner;
245-
struct OtherInner;
246-
template<typename T, typename U> void f(Inner<T, U>&);
247-
248-
typedef Inner<OtherInner, OtherInner> MyInner;
249-
template<> void f(MyInner&); // expected-error{{cannot specialize a function 'f' within class scope}}
250-
};
251-
}

0 commit comments

Comments
 (0)