From 83715bc4fd08c76e944493d87cb242c557650487 Mon Sep 17 00:00:00 2001 From: emsr Date: Sat, 20 Dec 2014 01:21:15 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218986 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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 7c0538d..47aa690 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 057776f..6cdb32c 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 fd6c398..85d11d0 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 ec93189..81daa04 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 36e1135..1292966 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 54f42e1..9c25fc3 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 0000000..b1a3dc5 --- /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 0000000..a91246f --- /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.7.4