1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #ifndef LIBCXX_TEST_TOOLS_CLANG_TIDY_CHECKS_UTILITIES_HPP |
10 | #define LIBCXX_TEST_TOOLS_CLANG_TIDY_CHECKS_UTILITIES_HPP |
11 | |
12 | #include <string_view> |
13 | |
14 | inline bool is_ugly_name(std::string_view str) { |
15 | if (str.size() < 2) |
16 | return false; |
17 | if (str[0] == '_' && str[1] >= 'A' && str[1] <= 'Z') |
18 | return true; |
19 | return str.find(str: "__") != std::string_view::npos; |
20 | } |
21 | |
22 | #endif // LIBCXX_TEST_TOOLS_CLANG_TIDY_CHECKS_UTILITIES_HPP |
23 |