[clang] Add tracking source deduction guide for the explicitly-written
[llvm-project.git] / clang-tools-extra / docs / clang-tidy / checks / llvmlibc / callee-namespace.rst
blobba742b5e1cab58aedb546cf74b0cf4c720833f93
1 .. title:: clang-tidy - llvmlibc-callee-namespace
3 llvmlibc-callee-namespace
4 ====================================
6 Checks all calls resolve to functions within correct namespace.
8 .. code-block:: c++
10     // Implementation inside the LIBC_NAMESPACE namespace.
11     // Correct if:
12     // - LIBC_NAMESPACE is a macro
13     // - LIBC_NAMESPACE expansion starts with `__llvm_libc`
14     namespace LIBC_NAMESPACE {
16     // Allow calls with the fully qualified name.
17     LIBC_NAMESPACE::strlen("hello");
19     // Allow calls to compiler provided functions.
20     (void)__builtin_abs(-1);
22     // Bare calls are allowed as long as they resolve to the correct namespace.
23     strlen("world");
25     // Disallow calling into functions in the global namespace.
26     ::strlen("!");
28     } // namespace LIBC_NAMESPACE