diff options
author | Marek Polacek <polacek@redhat.com> | 2020-05-15 00:05:33 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-06-26 15:29:07 -0400 |
commit | 0801f419440c14f6772b28f763ad7d40f7f7a580 (patch) | |
tree | 2873383514dfeb12a5bfcb5eadcdca510c88aeec /libgomp | |
parent | 0fce12c0920c12492c878c0ca5f639f93b93f183 (diff) | |
download | gcc-0801f419440c14f6772b28f763ad7d40f7f7a580.zip gcc-0801f419440c14f6772b28f763ad7d40f7f7a580.tar.gz gcc-0801f419440c14f6772b28f763ad7d40f7f7a580.tar.bz2 |
c++: Change the default dialect to C++17.
Since GCC 9, C++17 support is no longer experimental. It was too late
to change the default C++ dialect to C++17 in GCC 10, but I think now
it's time to pull the trigger (C++14 was made the default in GCC 6.1).
We're still missing two C++17 library features, but that shouldn't stop
us. See
<https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2017>
and
<https://gcc.gnu.org/projects/cxx-status.html#cxx17>
for the C++17 status.
I won't list all C++17 features here, but just a few heads-up:
- trigraphs were removed (hardly anyone cares, unless your keyboard is
missing the # key),
- operator++(bool) was removed (so some tests now run in C++14 and down
only),
- the keyword register was removed (some legacy code might trip on
this),
- noexcept specification is now part of the type system and C++17 does
not allow dynamic exception specifications anymore (the empty throw
specification is still available, but it is deprecated),
- the evaluation order rules are different in C++17,
- static constexpr data members are now implicitly inline (which makes
them definitions),
- C++17 requires guaranteed copy elision, meaning that a copy/move
constructor call might be elided completely. That means that if
something relied on a constructor being instantiated via e.g. copying
a function parameter, it might now fail.
I'll post an update for cxx-status.html and add a new caveat to changes.html
once this is in.
gcc/ChangeLog:
* doc/invoke.texi (C Dialect Options): Adjust -std default for C++.
* doc/standards.texi (C Language): Correct the default dialect.
(C++ Language): Update the default for C++ to gnu++17.
gcc/c-family/ChangeLog:
* c-opts.c (c_common_init_options): Default to gnu++17.
gcc/testsuite/ChangeLog:
* c-c++-common/torture/vector-subscript-3.c: In C++17, define away
the keyword register.
* g++.dg/cpp1z/attributes-enum-1a.C: Only run pre-C++17.
* g++.dg/cpp1z/fold7a.C: Likewise.
* g++.dg/cpp1z/nontype3a.C: Likewise.
* g++.dg/cpp1z/utf8-2a.C: Likewise.
* g++.dg/parse/error11.C: Update expected diagnostics for C++17.
* g++.dg/torture/pr34850.C: Add -Wno-attribute-warning.
* g++.dg/torture/pr49394.C: In C++17, use noexcept(false).
* g++.dg/torture/pr82154.C: Use -std=c++14.
* lib/target-supports.exp: Set to C++17.
* obj-c++.dg/try-catch-9.mm: Use -Wno-register.
libgomp/ChangeLog:
* testsuite/libgomp.c++/atomic-3.C: Use -std=gnu++14.
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/testsuite/libgomp.c++/atomic-3.C | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgomp/testsuite/libgomp.c++/atomic-3.C b/libgomp/testsuite/libgomp.c++/atomic-3.C index f957b2f..c02532d 100644 --- a/libgomp/testsuite/libgomp.c++/atomic-3.C +++ b/libgomp/testsuite/libgomp.c++/atomic-3.C @@ -1,5 +1,6 @@ // { dg-do run } -// { dg-options "-Wno-deprecated" } +// C++17 forbids ++ on bool. +// { dg-options "-Wno-deprecated -std=gnu++14" } extern "C" void abort (void); bool v, x1, x2, x3, x4, x5, x6; |