22 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=unix.cstring.BadSizeArg -verify %s2// expected-no-diagnostics3 4// Ensure we don't crash on C++ declarations with special names.5struct X {6 X(int i): i(i) {}7 int i;8};9 10X operator+(X a, X b) {11 return X(a.i + b.i);12}13 14void test(X a, X b) {15 X c = a + b;16}17 18// Ensure we don't crash on custom-defined strncat.19char strncat ();20int main () {21 return strncat ();22}