<commit_before>// RUN: %python %S/check_clang_tidy.py %s misc-new-delete-overloads %t -- -std=c++14

typedef decltype(sizeof(int)) size_t;

struct S {
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope [misc-new-delete-overloads]
  void *operator new(size_t size) noexcept;
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new[]' has no matching declaration of 'operator delete[]' at the same scope
  void *operator new[](size_t size) noexcept;
};

// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope
void *operator new(size_t size) noexcept;

struct T {
  // Sized deallocations are not enabled by default, and so this new/delete pair
  // does not match. However, we expect only one warning, for the new, because
  // the operator delete is a placement delete and we do not warn on mismatching
  // placement operations.
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope
  void *operator new(size_t size) noexcept;
  void operator delete(void *ptr, size_t) noexcept; // ok only if sized deallocation is enabled
};

struct U {
  void *operator new(size_t size) noexcept;
  void operator delete(void *ptr) noexcept;

  void *operator new[](size_t) noexcept;
  void operator delete[](void *) noexcept;
};

struct Z {<commit_msg>Some of the build bots are unhappy about the overload of the global operator new() because it was accidentally marked noexcept instead of noexcept(false). This should correct those bots.<commit_after>// RUN: %python %S/check_clang_tidy.py %s misc-new-delete-overloads %t -- -std=c++14

typedef decltype(sizeof(int)) size_t;

struct S {
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope [misc-new-delete-overloads]
  void *operator new(size_t size) noexcept;
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new[]' has no matching declaration of 'operator delete[]' at the same scope
  void *operator new[](size_t size) noexcept;
};

// CHECK-MESSAGES: :[[@LINE+1]]:7: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope
void *operator new(size_t size) noexcept(false);

struct T {
  // Sized deallocations are not enabled by default, and so this new/delete pair
  // does not match. However, we expect only one warning, for the new, because
  // the operator delete is a placement delete and we do not warn on mismatching
  // placement operations.
  // CHECK-MESSAGES: :[[@LINE+1]]:9: warning: declaration of 'operator new' has no matching declaration of 'operator delete' at the same scope
  void *operator new(size_t size) noexcept;
  void operator delete(void *ptr, size_t) noexcept; // ok only if sized deallocation is enabled
};

struct U {
  void *operator new(size_t size) noexcept;
  void operator delete(void *ptr) noexcept;

  void *operator new[](size_t) noexcept;
  void operator delete[](void *) noexcept;
};

struct Z {
{'fraction_non_alphanumeric': 0.11221326720396776, 'fraction_numerical': 0.006199628022318661, 'mean_word_length': 4.535162950257289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2485520', 'n_tokens_mistral': 984, 'n_tokens_neox': 960, 'n_words': 396}