22 lines · cpp
1// RUN: %clang_cc1 -std=c++03 -triple x86_64-pc-linux-gnu %s \2// RUN: -faligned-allocation -emit-llvm -o - -Wno-c++11-extensions | FileCheck %s3 4// Ensure Clang doesn't confuse std::align_val_t with the sized deallocation5// parameter when the enum type is unscoped. Libc++ does this in C++03 in order6// to support aligned allocation in that dialect.7 8using size_t = __decltype(sizeof(0));9 10namespace std {11enum align_val_t : size_t {};12}13_Static_assert(__is_same(__underlying_type(std::align_val_t), size_t), "");14 15// CHECK-LABEL: define{{.*}} void @_Z1fPi(16void f(int *p) {17 // CHECK-NOT: call void @_ZdlPvSt11align_val_t(18 // CHECK: call void @_ZdlPv(19 // CHECK: ret void20 delete p;21}22