summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp')
-rw-r--r--clang-tools-extra/test/clang-tidy/misc-unused-using-decls.cpp21
1 files changed, 20 insertions, 1 deletions
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 92977cc048d..4d6b33252f1 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
@@ -17,6 +17,8 @@ class I {
static int ii;
};
template <typename T> class J {};
+class G;
+class H;
class Base {
public:
@@ -99,6 +101,24 @@ DEFINE_INT(test);
USING_FUNC
#undef USING_FUNC
+namespace N1 {
+// n::G is used in namespace N2.
+// Currently, the check doesn't support multiple scopes. All the relevant
+// using-decls will be marked as used once we see an usage even the usage is in
+// other scope.
+using n::G;
+}
+
+namespace N2 {
+using n::G;
+void f(G g);
+}
+
+void IgnoreFunctionScope() {
+// Using-decls defined in function scope will be ignored.
+using n::H;
+}
+
// ----- Usages -----
void f(B b);
void g() {
@@ -112,4 +132,3 @@ void g() {
UsedTemplateFunc<int>();
cout << endl;
}
-
OpenPOWER on IntegriCloud