brintos

brintos / llvm-project-archived public Read only

0
0
Text · 755 B · 4b534cf Raw
14 lines · cpp
1// RUN: %clang_cc1 -fms-compatibility -fms-compatibility-version=19.33 -std=c++20 -ast-dump %s | FileCheck %s2 3// CHECK: used operator new4// CHECK: MSConstexprAttr 0x{{[0-9a-f]+}} <col:17, col:23>5[[nodiscard]] [[msvc::constexpr]] inline void* __cdecl operator new(decltype(sizeof(void*)), void* p) noexcept { return p; }6 7// CHECK: used constexpr construct_at8// CHECK: AttributedStmt 0x{{[0-9a-f]+}} <col:46, col:88>9// CHECK-NEXT: MSConstexprAttr 0x{{[0-9a-f]+}} <col:48, col:54>10// CHECK-NEXT: ReturnStmt 0x{{[0-9a-f]+}} <col:66, col:88>11constexpr int* construct_at(int* p, int v) { [[msvc::constexpr]] return ::new (p) int(v); }12constexpr bool check_construct_at() { int x; return *construct_at(&x, 42) == 42; }13static_assert(check_construct_at());14