Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/Wplacement-new-size-4.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/77804 - Internal compiler error on incorrect initialization of |
2 // new-d array | |
3 // { dg-do compile } | |
4 // { dg-additional-options "-Wplacement-new -Wvla -Wno-error=vla" } | |
5 | |
6 void* operator new[] (__SIZE_TYPE__ n, void *p) { return p; } | |
7 | |
8 int main() | |
9 { | |
10 char buf[256]; | |
11 unsigned n = 10; | |
12 int* p = new (buf) (int[n]); // { dg-warning "non-constant array new length must be specified without parentheses around the type-id" } | |
13 // { dg-warning "ISO C\\+\\+ forbids variable length array" "vla warning" { target *-*-* } .-1 } | |
14 } |