cstring-syntax-cxx.cpp 331 B

1234567891011121314151617
  1. // RUN: %clang_cc1 -analyze -analyzer-checker=unix.cstring.BadSizeArg -analyzer-store=region -verify %s
  2. // expected-no-diagnostics
  3. // Ensure we don't crash on C++ declarations with special names.
  4. struct X {
  5. X(int i): i(i) {}
  6. int i;
  7. };
  8. X operator+(X a, X b) {
  9. return X(a.i + b.i);
  10. }
  11. void test(X a, X b) {
  12. X c = a + b;
  13. }