Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / SemaCXX / placement-new-matrix.cpp
blob7168e60bdbb0072bec1287480ad53ec227221a74
1 // RUN: %clang_cc1 -fenable-matrix -fsyntax-only -verify %s -std=c++11
3 using Matrix = int __attribute__((matrix_type(4, 3)));
5 template <__SIZE_TYPE__ a, __SIZE_TYPE__ b>
6 using TMatrix = int __attribute__((matrix_type(a, b)));
8 struct S {
9 void* operator new(__SIZE_TYPE__, int);
10 void* operator new(__SIZE_TYPE__, Matrix);
11 void* operator new(__SIZE_TYPE__, TMatrix<2, 2>);
14 int main() {
15 Matrix m;
16 TMatrix<2, 2> tm;
18 new (m) S {};
19 new (tm) S {};
21 new (m[1][1]) S {};
22 new (tm[1][1]) S {};
24 new (m[1]) S {}; // expected-error {{single subscript expressions are not allowed for matrix values}}
25 new (tm[1]) S {}; // expected-error {{single subscript expressions are not allowed for matrix values}}