gecko-dev/tools/clang-tidy/test/misc-unused-alias-decls.cpp
Chris Peterson 6f691d73b1 Bug 1475882 - clang-tidy: Enable misc-unused-alias-decls check. r=andi
This check finds unused namespace alias declarations. There are currently no misc-unused-alias-decls warnings in mozilla-central!

https://clang.llvm.org/extra/clang-tidy/checks/misc-unused-alias-decls.html

MozReview-Commit-ID: LHziGESvaM5

--HG--
extra : rebase_source : f10fbb6364bc947b5fa2ca8c0b47494519856940
extra : source : 987ca732290093c4bd36690c6ebd3ed2ac0b5444
2018-07-09 11:04:31 -07:00

19 lines
345 B
C++

// https://clang.llvm.org/extra/clang-tidy/checks/misc-unused-alias-decls.html
namespace n1 {
namespace n2 {
namespace n3 {
int qux = 42;
}
}
}
namespace n1_unused = ::n1; // WARNING
namespace n12_unused = n1::n2; // WARNING
namespace n123 = n1::n2::n3; // OK
int test()
{
return n123::qux;
}