Issue 53174
Summary clang-tidy: cppcoreguidelines-pro-bounds-array-to-pointer-decay complains about any assert() with glibc 2.34.11.
Labels new issue
Assignees
Reporter reddwarf69
    The cppcoreguidelines-pro-bounds-array-to-pointer-decay clang-tidy checks complains about any assert() when using glibc 2.34.11 (Fedora 35).

```
$ cat test.cpp 
#include <cassert>

void test() {
    assert(1);
}
$ clang-tidy --checks='-*,cppcoreguidelines-pro-bounds-array-to-pointer-decay' test.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "test.cpp"
No compilation database found in /home/reddwarf/tmp or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
1 warning generated.
/home/reddwarf/tmp/test.cpp:4:5: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
    assert(1);
    ^
/usr/include/assert.h:92:51: note: expanded from macro 'assert'
      : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
                                                  ^
/usr/include/assert.h:126:30: note: expanded from macro '__ASSERT_FUNCTION'
#   define __ASSERT_FUNCTION    __extension__ __PRETTY_FUNCTION__
                                ^
$ rpm -qf /usr/include/assert.h 
glibc-headers-x86-2.34-11.fc35.noarch
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to