Implement P0001R1 - C++17 removal of register storage class specifier c-family/
authorJakub Jelinek <jakub@redhat.com>
Thu, 29 Sep 2016 20:54:56 +0000 (22:54 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 29 Sep 2016 20:54:56 +0000 (22:54 +0200)
commita2c6e7f26ec122124c91ca215a285da69d19fac9
treeb3e64a502f5b3a95fa0f9261eb01a744d71fd489
parent0a2d7bc05a7de689cb3fde82109e74a0b72e535c
Implement P0001R1 - C++17 removal of register storage class specifier c-family/

Implement P0001R1 - C++17 removal of register storage class specifier
c-family/
* c.opt (Wregister): New warning.
* c-opts.c (c_common_post_options): Enable -Wregister by
default for C++17.
cp/
* decl.c (cp_finish_decl): Diagnose register storage class
on vars except when used in GNU global or local register variable
extension.
(grokdeclarator): Diagnose register storage class on parameters.
* except.c (expand_start_catch_block): Set DECL_REGISTER only
after cp_finish_decl call.
testsuite/
* c-c++-common/Wvarargs-2.c (foo1): Except new warning for C++17.
* c-c++-common/vector-subscript-2.c (vf): Expect new error for
C++17.
* c-c++-common/vector-subscript-5.c (foo): Don't use register
keyword if not __SSE2__.
* c-c++-common/Wvarargs.c (foo1, foo3): Expect new warnings for
C++17.
* g++.dg/compat/struct-layout-1_generate.c (iterative_hash): Remove
register keywords.
* g++.dg/eh/pr29166.C: Add -Wno-register option.
* g++.dg/warn/register-parm-1.C (erroneous_warning,
no_erroneous_warning): Expect new warnings for C++17.
* g++.dg/warn/register-var-2.C (f): Likewise.
* g++.dg/parse/register1.C (f): Expect new error for C++17.
* g++.dg/parse/linkage2.C (foo): Likewise.
* g++.dg/torture/pr36826.C (CoinMin, CoinMax): Avoid register
keyword on parameters for C++17.
* g++.dg/cpp1z/register1.C: New test.
* g++.dg/cpp1z/register2.C: New test.
* g++.dg/cpp1z/register3.C: New test.

From-SVN: r240638
21 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-opts.c
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/except.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wvarargs-2.c
gcc/testsuite/c-c++-common/Wvarargs.c
gcc/testsuite/c-c++-common/vector-subscript-2.c
gcc/testsuite/c-c++-common/vector-subscript-5.c
gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c
gcc/testsuite/g++.dg/cpp1z/register1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/register2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1z/register3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/eh/pr29166.C
gcc/testsuite/g++.dg/parse/linkage2.C
gcc/testsuite/g++.dg/parse/register1.C
gcc/testsuite/g++.dg/torture/pr36826.C
gcc/testsuite/g++.dg/warn/register-parm-1.C
gcc/testsuite/g++.dg/warn/register-var-2.C