Author: majnemer Date: Sun Aug 18 21:43:08 2013 New Revision: 188647 URL: http://llvm.org/viewvc/llvm-project?rev=188647&view=rev Log: Sema: Remove dead code in CheckTemplateArgumentAddressOfObjectOrFunction
Summary: DeclRefExpr::getDecl gives us back a ValueDecl, this isa<> check will never fire. Reviewers: eli.friedman, doug.gregor, majnemer Reviewed By: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1434 Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/lib/Sema/SemaTemplate.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=188647&r1=188646&r2=188647&view=diff ============================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sun Aug 18 21:43:08 2013 @@ -2952,9 +2952,6 @@ def err_template_arg_ref_bind_ignores_qu "ignores qualifiers">; def err_template_arg_not_decl_ref : Error< "non-type template argument does not refer to any declaration">; -def err_template_arg_not_object_or_func_form : Error< - "non-type template argument does not directly refer to an object or " - "function">; def err_template_arg_not_address_of : Error< "non-type template argument for template parameter of pointer type %0 must " "have its address taken">; Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=188647&r1=188646&r2=188647&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaTemplate.cpp (original) +++ cfe/trunk/lib/Sema/SemaTemplate.cpp Sun Aug 18 21:43:08 2013 @@ -4169,14 +4169,6 @@ CheckTemplateArgumentAddressOfObjectOrFu return true; } - if (!isa<ValueDecl>(DRE->getDecl())) { - S.Diag(Arg->getLocStart(), - diag::err_template_arg_not_object_or_func_form) - << Arg->getSourceRange(); - S.Diag(Param->getLocation(), diag::note_template_param_here); - return true; - } - ValueDecl *Entity = DRE->getDecl(); // Cannot refer to non-static data members _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
