}
}
- /* Set C++ standard to C++14 if not specified on the command line. */
+ /* Set C++ standard to C++17 if not specified on the command line. */
if (c_dialect_cxx ())
- set_std_cxx14 (/*ISO*/false);
+ set_std_cxx17 (/*ISO*/false);
global_dc->colorize_source_p = true;
}
@item gnu++14
@itemx gnu++1y
GNU dialect of @option{-std=c++14}.
-This is the default for C++ code.
The name @samp{gnu++1y} is deprecated.
@item c++17
@item gnu++17
@itemx gnu++1z
GNU dialect of @option{-std=c++17}.
+This is the default for C++ code.
The name @samp{gnu++1z} is deprecated.
@item c++20
extensions).
The default, if no C language dialect options are given,
-is @option{-std=gnu11}.
+is @option{-std=gnu17}.
The ISO C standard defines (in clause 4) two classes of conforming
implementation. A @dfn{conforming hosted implementation} supports the
@option{-std=gnu++17} (for C++17 with GNU extensions).
The default, if
-no C++ language dialect options are given, is @option{-std=gnu++14}.
+no C++ language dialect options are given, is @option{-std=gnu++17}.
@section Objective-C and Objective-C++ Languages
@cindex Objective-C
vector short member;
};
+#if defined(__cplusplus) && __cplusplus >= 201703L
+#define register /* nothing */
+#endif
int main () {
register short vector v0 = {1,2,3,4,5,6,7};
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_enumerator_attributes
#error __cpp_enumerator_attributes defined
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_fold_expressions
#error __cpp_fold_expressions defined
-// This macro should not be defined without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be defined without c++17.
#ifdef __cpp_nontype_template_args
#error __cpp_nontype_template_args defined
-// This macro should not be 201411 without -std=c++17.
+// { dg-do compile { target c++14_down } }
+// This macro should not be 201411 without c++17.
#if __cpp_unicode_characters == 201411
#error Wrong value for __cpp_unicode_characters
// { dg-do compile }
-// { dg-options "-fshow-column" }"
+// { dg-options "-fshow-column" }
// Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
// Try to find out when the digraph '<:' is used as a mistake, and parse it
// correctly to avoid cascaded errors.
// the special error message.
Foo<: :B> k2; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
Foo[:B> k1; // { dg-bogus "cannot begin|alternate spelling" "smart error should not be triggered here" }
-// { dg-error "6:missing template arguments before" "template" { target *-*-* } 51 }
-// { dg-error "9:expected primary-expression before ':' token" "primary" { target *-*-* } 51 }
-// { dg-error "8:expected '\]' before ':' token" "backslash" { target *-*-* } 51 }
-// { dg-error "6:missing template arguments before" "template" { target *-*-* } 52 }
-// { dg-error "7:expected primary-expression before ':' token" "primary" { target *-*-* } 52 }
-// { dg-error "7:expected '\]' before ':' token" "backslash" { target *-*-* } 52 }
+// { dg-error "6:missing template arguments before" "template" { target c++14_down } .-2 }
+// { dg-error "9:expected primary-expression before ':' token" "primary" { target c++14_down } .-3 }
+// { dg-error "8:expected '\]' before ':' token" "backslash" { target c++14_down } .-4 }
+// { dg-error "6:missing template arguments before" "template" { target c++14_down } .-4 }
+// { dg-error "7:expected primary-expression before ':' token" "primary" { target c++14_down } .-5 }
+// { dg-error "7:expected '\]' before ':' token" "backslash" { target c++14_down } .-6 }
+// { dg-error "9:expected identifier" "" { target c++17 } .-8 }
+// { dg-error "8:expected" "" { target c++17 } .-9 }
+// { dg-error "7:expected identifier" "" { target c++17 } .-9 }
+// { dg-error "7:expected" "" { target c++17 } .-10 }
//
int Foo[2];
Foo[::value] = 0;
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
-/* { dg-options "-ffat-lto-objects -Wno-return-type" } */
+/* { dg-options "-ffat-lto-objects -Wno-return-type -Wno-attribute-warning" } */
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
~Mutex ()
#if __cplusplus <= 201402L
throw(int) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
+#else
+ noexcept(false)
#endif
{
if (locked)
// { dg-do compile }
-// { dg-additional-options "-Wno-deprecated" }
+// { dg-additional-options "-std=c++14 -Wno-deprecated" }
+// C++17 does not allow dynamic exception specification.
namespace a {
int b;
return 0
}
-set cxx_default "c++14"
+set cxx_default "c++17"
# Check whether the current active language standard supports the features
# of C++11/C++14 by checking for the presence of one of the -std flags.
# This assumes that the default for the compiler is $cxx_default, and that
/* { dg-xfail-run-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" "-fgnu-runtime" } { "" } }
/* { dg-prune-output ".*internal compiler error.*" } */
-/* { dg-options "-fobjc-exceptions -O2" } */
+/* { dg-options "-fobjc-exceptions -O2 -Wno-register" } */
#include "../objc-obj-c++-shared/TestsuiteObject.m"
#include <stdlib.h>
// { 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;