From a7fa8d1819c55bfb78993eac3aabc38bbc225f69 Mon Sep 17 00:00:00 2001 From: Edward Smith-Rowland <3dw4rd@verizon.net> Date: Sat, 20 Dec 2014 01:21:15 +0000 Subject: [PATCH] c-cppbuiltin.c (__cpp_sized_deallocation): Uncomment and move macro. c-family/ 2014-12-20 Edward Smith-Rowland <3dw4rd@verizon.net> * c-cppbuiltin.c (__cpp_sized_deallocation): Uncomment and move macro. Control macro with flag_sized_deallocation. testsuite/ 2014-12-20 Edward Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp1y/feat-cxx98-neg.C: Enable __cpp_sized_deallocation test. * g++.dg/cpp1y/feat-cxx14.C: Ditto. * g++.dg/cpp1y/feat-cxx11-neg.C: Ditto and move tests for consistent order. * g++.dg/cpp1y/feat-sized-dealloc-neg.C: New. * g++.dg/cpp1y/feat-sized-dealloc.C: New. From-SVN: r218986 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-cppbuiltin.c | 3 ++- gcc/testsuite/ChangeLog | 9 +++++++++ gcc/testsuite/g++.dg/cpp1y/feat-cxx11-neg.C | 8 ++++++-- gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C | 5 +++-- gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C | 7 +++---- gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc-neg.C | 6 ++++++ gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc.C | 10 ++++++++++ 8 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc-neg.C create mode 100644 gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc.C diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 7c0538d5da4..47aa690dae7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2014-12-20 Edward Smith-Rowland <3dw4rd@verizon.net> + + * c-cppbuiltin.c (__cpp_sized_deallocation): Uncomment and move macro. + Control macro with flag_sized_deallocation. + 2014-12-20 Martin Uecker * c.opt (Wdiscarded-array-qualifiers): New option. diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 057776ff504..6cdb32ceebe 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -866,8 +866,9 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__cpp_aggregate_nsdmi=201304"); cpp_define (pfile, "__cpp_variable_templates=201304"); cpp_define (pfile, "__cpp_digit_separators=201309"); - //cpp_define (pfile, "__cpp_sized_deallocation=201309"); } + if (flag_sized_deallocation) + cpp_define (pfile, "__cpp_sized_deallocation=201309"); } /* Note that we define this for C as well, so that we know if __attribute__((cleanup)) will interface with EH. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fd6c398ef88..85d11d01507 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2014-12-19 Edward Smith-Rowland <3dw4rd@verizon.net> + + * g++.dg/cpp1y/feat-cxx98-neg.C: Enable __cpp_sized_deallocation test. + * g++.dg/cpp1y/feat-cxx14.C: Ditto. + * g++.dg/cpp1y/feat-cxx11-neg.C: Ditto and move tests for consistent + order. + * g++.dg/cpp1y/feat-sized-dealloc-neg.C: New. + * g++.dg/cpp1y/feat-sized-dealloc.C: New. + 2014-12-20 Martin Uecker * gcc.dg/Wwrite-strings-1.c: Change dg-warning. diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11-neg.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11-neg.C index ec931891173..81daa04b4de 100644 --- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11-neg.C +++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11-neg.C @@ -22,6 +22,10 @@ # error "__cpp_return_type_deduction" // { dg-error "error" } #endif +#ifndef __cpp_aggregate_nsdmi +# error "__cpp_aggregate_nsdmi" // { dg-error "error" } +#endif + #ifndef __cpp_variable_templates # error "__cpp_variable_templates" // { dg-error "error" } #endif @@ -30,8 +34,8 @@ # error "__cpp_digit_separators" // { dg-error "error" } #endif -#ifndef __cpp_aggregate_nsdmi -# error "__cpp_aggregate_nsdmi" // { dg-error "error" } +#ifndef __cpp_sized_deallocation +# error "__cpp_sized_deallocation" // { dg-error "error" } #endif // Array TS features: diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C index 36e11354fb7..129296664c1 100644 --- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C +++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C @@ -175,9 +175,10 @@ # error "__cpp_digit_separators != 201309" #endif -// Sized deallocation not in yet. -#ifdef __cpp_sized_deallocation +#ifndef __cpp_sized_deallocation # error "__cpp_sized_deallocation" +#elif __cpp_sized_deallocation != 201309 +# error "__cpp_sized_deallocation != 201309" #endif // GNU VLA support: diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C index 54f42e1841a..9c25fc3780a 100644 --- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C +++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C @@ -109,10 +109,9 @@ # error "__cpp_digit_separators" // { dg-error "error" } #endif -// Sized deallocation not in yet. -//#ifdef __cpp_sized_deallocation -//# error "__cpp_sized_deallocation" -//#endif +#ifndef __cpp_sized_deallocation +# error "__cpp_sized_deallocation" // { dg-error "error" } +#endif // C++11 attributes: diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc-neg.C b/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc-neg.C new file mode 100644 index 00000000000..b1a3dc5e157 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc-neg.C @@ -0,0 +1,6 @@ +// { dg-do compile { target c++14 } } +// { dg-options "-fno-sized-deallocation" } + +#ifndef __cpp_sized_deallocation +# error "__cpp_sized_deallocation" // { dg-error "error" } +#endif diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc.C b/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc.C new file mode 100644 index 00000000000..a91246ff5a3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/feat-sized-dealloc.C @@ -0,0 +1,10 @@ +// { dg-do compile { target c++11_only } } +// { dg-options "-fsized-deallocation" } + +// C++14 features: + +#ifndef __cpp_sized_deallocation +# error "__cpp_sized_deallocation" +#elif __cpp_sized_deallocation != 201309 +# error "__cpp_sized_deallocation != 201309" +#endif -- 2.30.2