aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/new-aligned.cpp
blob: 041e63ec24debba2c0d1e5979a12d3c61000be40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//RUN: %clang_analyze_cc1 -std=c++17 -analyzer-checker=core -verify %s

// expected-no-diagnostics

// Notice the weird alignment.
struct alignas(1024) S {};

void foo() {
  // Operator new() here is the C++17 aligned new that takes two arguments:
  // size and alignment. Size is passed implicitly as usual, and alignment
  // is passed implicitly in a similar manner.
  S *s = new S; // no-warning
  delete s;
}