From da2a58dd0b261d6af2ecca61f549ab2bd8135ec6 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 2 Aug 2016 11:26:35 +0000 Subject: [clang-tidy] Fix an unused-using-decl false positive about template arguments in function call expression. Summary: The check doesn't mark the template argument as used when the template argument is a template. Reviewers: djasper, alexfh Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D22803 llvm-svn: 277444 --- .../test/clang-tidy/misc-unused-using-decls.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp') diff --git a/clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp b/clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp index 618a9f661f9..fec49496c2b 100644 --- a/clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp +++ b/clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s misc-unused-using-decls %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s misc-unused-using-decls %t -- -- -fno-delayed-template-parsing -isystem %S/Inputs/ + // ----- Definitions ----- template class vector {}; @@ -54,6 +55,16 @@ enum Color4 { Blue }; } // namespace n +#include "unused-using-decls.h" +namespace ns { +template +class AA { + T t; +}; +template +T ff() { T t; return t; } +} // namespace ns + // ----- Using declarations ----- // eol-comments aren't removed (yet) using n::A; // A @@ -136,6 +147,9 @@ using n::Color2; using n::Color3; using n::Blue; +using ns::AA; +using ns::ff; + // ----- Usages ----- void f(B b); void g() { @@ -151,4 +165,9 @@ void g() { Color2 color2; int t1 = Color3::Yellow; int t2 = Blue; + + MyClass a; + int t3 = 0; + a.func1(&t3); + a.func2(t3); } -- cgit v1.2.3