* g++.dg/*.C: Use target c++17 instead of explicit dg-options.
* lib/g++-dg.exp: Don't test C++11 by default. Add C++17 to
the list of default stds to test.
From-SVN: r265343
+2018-10-20 Marek Polacek <polacek@redhat.com>
+
+ * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
+ * lib/g++-dg.exp: Don't test C++11 by default. Add C++17 to
+ the list of default stds to test.
+
2018-10-20 Jakub Jelinek <jakub@redhat.com>
PR middle-end/87647
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T1, class T2> class A { };
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class...> class tuple {};
// PR c++/85006
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
template<typename... Ts> struct A {};
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
concept bool Isint = __is_same_as(T,int);
// PR c++/85706
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
template<class T> struct S {
S(T);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool One() { return sizeof(T) >= 4; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool One() { return sizeof(T) >= 4; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// PR c++/84551
-// { dg-options "-g -O -std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-g -O -fconcepts" }
template<typename> concept bool C() { return true; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
typedef concept int CINT; // { dg-error "'concept' cannot appear in a typedef declaration" }
// PR c++/67007
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class U>
concept bool A =
// PR c++/67159
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U>
concept bool SameAs = __is_same_as(T, U);
// PR c++/66962
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <typename> struct remove_cv;
template <typename> struct is_reference;
// PR c++/66092
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <type_traits>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check equivalence of short- and longhand declarations.
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
// template<typename T>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
struct A {
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
#include <iostream>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1()
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C()
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#ifndef __cpp_concepts
#error __cpp_concepts not defined
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Tuple() { // { dg-error "multiple statements" }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept auto C1() { return 0; } // { dg-error "16:concept .concept auto C1\\(\\). declared with a deduced return type" }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-do compile }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Test that constraint satisfaction checks work even when
// processing template declarations.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check shorthand notation.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Redefinition errors.
-// { dg-do link }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do link { target c++17 } }
+// { dg-options "-fconcepts" }
// FIXME: What is this actually testing?
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class() { return __is_class(T); }
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Eq() { return requires(T t) { t == t; }; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Eq() { return requires(T t) { t == t; }; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
#include <type_traits>
// PR c++/67240
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
int foo(int x)
{
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C = __is_class(T);
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename ... T>
concept bool C1 = true;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename ... T>
concept bool C1 = true;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T, typename U = int>
concept bool C()
// PR c++/67003
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
namespace X {
template<class>
// PR c++/66985
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <template <class> class T>
concept bool _Valid = requires { typename T<int>; };
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
struct S
{
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct Base {
template<typename T>
-// { dg-do run}
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
-// { dg-do run}
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
#include <cassert>
// PR c++/72415
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<int... Indices>
struct indices {};
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
struct A {
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Type() { return true; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Make sure that we check partial concept ids
// with variable concepts.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check that constraints don't break unconstrained partial
// specializations.
// PR c++/67084
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
constexpr bool p = false;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T> struct A { };
template <class T> requires false struct A<T*> { };
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T> concept bool is_int = __is_same_as(T,int);
// PR c++/67138
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
concept bool _Auto = true;
// PR c++/67152
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
concept bool HasType = requires { typename T::type; };
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T, typename U>
struct is_same
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check argument deduction constraints.
// TODO: We shoul have more of these...
// PR c++/66218
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
// PR c++/66218
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U>
concept bool Same = __is_same_as(T, U);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <int I> struct B { static const int i = I; };
template <int I> concept bool Few = I < 10;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Concept() {
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C = false;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1() {
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
using TD = int;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C()
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Performance test... This should be fast.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Handle alias templates in type requirements.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1()
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<class T> concept bool C1 = true;
template<class A, class B> struct Pair {};
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class X> concept bool allocatable = requires{{new X}->X * };
template <class X> concept bool semiregular = allocatable<X>;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class>
concept bool C1 () {
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <typename, typename>
struct is_same {
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct inner;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<class T>
concept bool Addable(){
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
void f1(int a) requires true; // OK
auto f2(int a) -> bool requires true; // OK
-// { dg-do compile }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Test that standard conversions are checked with
// implicit conversion constraints.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check that we can evaluate constant requires-expressions
// as constant expressions, for the curious case when they
// PR c++/66218
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <type_traits>
// PR c++/66758
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class...Args>
concept bool Constructible =
// PR c++/66758
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U>
concept bool C = requires (T t, U u) { t + u; };
// PR c++/66832
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class U, unsigned N>
requires requires (T& t, U &u) { t.foo(); u.foo(); }
// PR c++/66988
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <type_traits>
// PR c++/67018
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <typename T>
constexpr bool Val = true;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class> struct all_same {
static constexpr bool value = 1;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct B
{
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T> concept bool C = true;
-// { dg-do run }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do run { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Class () { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct fool {
constexpr fool operator&&(fool) const { return {}; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct fool { };
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct X { };
int operator==(X, X) { return 0; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <vector>
-// { dg-do compile }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
// Check that type requirements are normalized correctly.
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
struct S1 {};
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<int N, class T>
concept bool P() { return true; }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool NameProvider()
// Conceptized version of template/ttp23.C
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T> concept bool Foo = true;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_same_as(T, int);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename... Ts> struct are_same;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename... Ts> struct are_same;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
// PR c++/66937
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
#include <tuple>
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Nothrow_assignable() { return __has_nothrow_assign(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool Nothrow_assignable() { return __has_nothrow_assign(T); }
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T>
concept bool C1 = __is_class(T);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T, typename U>
concept bool Same = __is_same_as(T, U);
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename T1, typename T2>
concept bool C1 = true;
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
concept int C = true; // { dg-error "bool" }
// PR c++/85133
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
template<typename> concept bool C; // { dg-error "no initializer" }
// PR c++/67117
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
requires false
// PR c++/67139
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T>
constexpr typename T::type::value_type _v = T::type::value;
// PR c++/68666
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
struct A {
template <class>
// PR c++/66712
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T, class...Args>
concept bool _Constructible_ =
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template <class T> concept bool Copyable = requires (T t) { T(t); };
template <class T> concept bool Constructable = requires { T(); };
// PR c++/73456
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
template<typename...> struct list {};
// PR c++/86981
-// { dg-options "-Wpessimizing-move -std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wpessimizing-move" }
#include <utility>
#include <optional>
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
struct base1 { int b1, b2 = 42; };
struct base2 {
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct derived;
struct base {
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct derived;
struct base { };
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
struct derived;
struct base { };
-// { dg-options "-std=c++17 -w" }
-// { dg-do run }
+// { dg-options "-w" }
+// { dg-do run { target c++17 } }
struct A { };
struct B: A { int i; };
-// { dg-options "-std=c++17 -w" }
-// { dg-do run }
+// { dg-options "-w" }
+// { dg-do run { target c++17 } }
struct A { };
struct B: A { int i; };
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
#ifndef __STDCPP_DEFAULT_NEW_ALIGNMENT__
#error __STDCPP_DEFAULT_NEW_ALIGNMENT__ not defined
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
#include <new>
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
#include <new>
// PR c++/77742
-// { dg-options "-Wall -std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wall" }
#include <new>
// PR c++/82760
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
#include <new>
#include <cstddef>
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
#ifndef __cpp_enumerator_attributes
#error __cpp_enumerator_attributes not defined
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int
fn (bool b)
// Test for std::byte aliasing properties.
-// { dg-options "-std=c++17 -O3" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-O3" }
#include <cstddef>
-// { dg-options "-std=c++17 -Wall" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wall" }
#include <cstddef>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <vector>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <utility>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <tuple>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <initializer_list>
template <class T>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class T> struct S{S(T){}};
// PR c++/77912
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class T> struct S{S(T){}};
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
// PR c++/77890
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class F> struct S{S(F&&f){}};
void f()
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class T, class D = int>
struct S { T t; };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <template <class> class T>
void f()
{
T t = 42; // { dg-error "B" }
-};
+}
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
// PR c++/78894
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A
{
// Testcase from P0512R0 for C++17 NB comment US 19
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename> struct remove_ref;
template<typename _Tp> struct remove_ref { typedef _Tp type; };
// Testcase from P0512R0 for C++17 NB comment US 20
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class,class> struct same;
template <class T> struct same<T,T> {};
// PR c++/79316
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename T> struct S { S(T t) {} };
template<typename T> S(T, int = 7) -> S<T>;
// PR c++/79350
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
// PR c++/79500
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename T> struct A {};
A(...) -> A<int>;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int I>
struct A { };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T = void> struct A { };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A {
A(T); // #1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <initializer_list>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class,class> struct same;
template <class T> struct same<T,T> {};
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A {
A(T&);
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A {
using value_type = T;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A { };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int I, int J>
struct A { };
// PR c++/81180
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template < int I > struct int_{};
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <initializer_list>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <initializer_list>
// PR c++/79790
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int N>
struct array
// PR c++/80412
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename> struct A;
template <typename> struct B : A < B { , // { dg-error "" }
// PR c++/82308
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename, unsigned>
struct array {};
// PR c++/80449
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class S> struct C;
template<> struct C<int> { C(int, int) {} };
// PR c++/82468
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <template <class> class TT>
TT(double) -> TT<int>; // { dg-error "template template" }
// PR c++/84015
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int I>
struct A { };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
// PR c++/84355
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class, class> struct same;
template <class T> struct same<T,T> {};
// PR c++/84937
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<int, int> struct A {};
// PR c++/84768
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename> struct A {};
// PR c++/82152
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct Base {};
// PR c++/85883
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T>
struct Bar
// PR c++/85883
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T1, typename T2>
struct Bar
// PR c++/85883
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T1, typename T2, typename T3>
struct Bar
// PR c++/86098
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class _Res> class future;
template <class T> T&& declval();
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
namespace N {
template <class T>
// PR c++/83692
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct integer {
constexpr int value() const { return m_value; }
// PR c++/84684
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
typedef decltype (sizeof (0)) size_t;
// PR c++/78948
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int T>
void sizeof_mismatch()
// Test that discarded statements differ from unevaluated operands in some
// ways.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A { int i; };
// PR c++/80562
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct T {
constexpr auto foo() { return false; }
// PR c++/83273
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int main()
{
// PR c++/84421
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A{
constexpr operator bool() const { return true; }
// PR c++/84854
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
constexpr int foo () { return 1; }
constexpr int foo (int) { return 2; }
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A
{
// PR c++/85149
-// { dg-do run }
-// { dg-additional-options -std=c++17 }
+// { dg-do run { target c++17 } }
template <typename T> struct is_void { static constexpr bool value = false; };
template <> struct is_void<void> { static constexpr bool value = true; };
// PR c++/85200
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T>
void f(){
// PR c++/85200
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A{
constexpr operator int(){ return 0; }
// PR c++/85214
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct g {
constexpr operator int() { return true; }
// PR c++/85032
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A
{
// PR c++/85695
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T, T v>
struct integral_constant {
// PR c++/85842
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class T>
auto f = [](auto&& arg) -> T* {
// PR c++/86480
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class...> constexpr bool val = true;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
constexpr auto Add5 = [](int i) { return i+5; };
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void g() {
const int n = 0;
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
// 'v' & 'm' are odr-used but do not occur in a constant-expression within the nested
// lambda, so are well-formed.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void f(int i)
{
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto l1 = []() constexpr constexpr { }; // { dg-error "duplicate" }
auto l2 = []() mutable mutable { }; // { dg-error "duplicate" }
// PR c++/78131
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename TF>
constexpr auto f(TF)
// PR c++/82570
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
template< typename Body >
inline void iterate(Body body)
// PR c++/84098
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A{};
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
constexpr int AddEleven(int n){
return[n]{return n+11;}();
// PR c++/82022
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
void f2()
// PR c++/85228
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<int> struct A
{
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
constexpr auto add = [] (int n, int m) {
auto L = [=] { return n; };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto ID = [] (int n) constexpr { return n; };
constexpr int I = ID(3);
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto addOne = [] (int n) {
return n + 1;
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto monoid = [](auto v) { return [=] { return v; }; };
auto add = [](auto m1) constexpr {
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto ID = [](auto a) { return a; };
static_assert( ID (3) == 3); // OK
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
auto Fwd = [](int (*fp)(int), auto a) { return fp(a); };
auto C = [](auto a) { return a; };
// Testcase from P0170R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
static_assert([](int n) { return [&n] { return ++n; }(); }(3) == 4);
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17_only } }
#if __cplusplus != 201703L
#error "__cplusplus != 201703L"
// Test of bit-fields.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A { long i: 2; } a;
// Test for reference address comparison in constant expression.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int i[2];
struct A { int i, j; } a;
// PR c++/84420
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int main(){
int a[1]{};
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
namespace std {
template<typename T> struct tuple_size;
// Test for decltype of direct decomposition.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class,class> struct same_type;
template <class T> struct same_type<T,T> {};
// PR c++/78358
-// { dg-do run }
-// { dg-options -std=c++17 }
+// { dg-do run { target c++17 } }
#include <tuple>
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
struct A { bool a, b; };
struct B { int a, b; };
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
struct A { bool a, b; };
struct B { int a, b; };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <tuple>
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A { int i,j; };
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int a[3];
struct S { int b, c, d; } s;
// PR c++/80084
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
struct A
{
-// { dg-options "-std=c++17 -Wunused" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wunused" }
#include <tuple>
// PR c++/81258
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int a[2];
auto [b, c] (a);
-// { dg-additional-options -std=c++17 }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
#include <memory>
#include <tuple>
-// { dg-additional-options -std=c++17 }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
class X
{
-// { dg-do run }
-// { dg-options -std=c++17 }
+// { dg-do run { target c++17 } }
#define assert(X) do { if (!(X)) __builtin_abort(); } while (0)
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct A
{
// P0145R2: Refining Expression Order for C++
-// { dg-do run }
-// { dg-options "-std=c++17" }
+// { dg-do run { target c++17 } }
#include <string>
#define assert(X) if (!(X)) __builtin_abort();
// P0145R2: Refining Expression Order for C++
-// { dg-do run }
-// { dg-options "-std=c++17" }
+// { dg-do run { target c++17 } }
extern "C" int printf (const char *, ...);
void sink(...) { }
// PR c/7652
-// { dg-do compile }
-// { dg-options "-std=c++17 -Wextra -Wall -Wpedantic" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wextra -Wall -Wpedantic" }
// Check that we accept attribute [[fallthrough]].
-// { dg-options "-std=c++17 -I${srcdir}/g++.dg/cpp1y -I${srcdir}/g++.dg/cpp1y/testinc" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-I${srcdir}/g++.dg/cpp1y -I${srcdir}/g++.dg/cpp1y/testinc" }
// C++98 features:
// PR c++/67926
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <bool ... T> bool FUR = (T && ...);
template <bool ... T> bool FUL = (... && T);
-// { dg-do run }
-// { dg-options -std=c++17 }
+// { dg-do run { target c++17 } }
template <class... T>
auto f() {
// PR c++/85305
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <int... Is>
void foo()
// PR c++/71711
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template < int > struct A {};
template < int ... N > void unary_left (A < (... + N) >);
-// { dg-do run }
-// { dg-options "-std=c++17" }
+// { dg-do run { target c++17 } }
+// { dg-options "" }
#include <cassert>
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
// Check that we can fold over all of the operators required
// by the standard in every possible way.
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
// Check that empty expansions and required failures.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class...T>
constexpr auto f(T... t)
// Test that we reject a fold-expression with an LHS that is not a
// cast-expression.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int i;
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
#ifndef __cpp_fold_expressions
#error __cpp_fold_expressions not defined
// PR c++/68377
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct Sink { } s;
template <class T> Sink& operator<<(Sink&, const T&);
// PR c++/71285
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<typename... Args>
void spurious(Args... args)
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
// Test C++17 selection statements with initializer, basic use.
extern int foo (void);
-// { dg-do run }
-// { dg-options -std=c++17 }
+// { dg-do run { target c++17 } }
// Test C++17 selection statements with initializer, side-effects.
int
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
extern int foo (void);
extern void bar (int), die (void);
// Testcase from P0305R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
enum class status_code { SUCCESS };
extern int get_value ();
// Testcase from P0305R1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <string>
#include <map>
-// { dg-do run }
-// { dg-options -std=c++17 }
+// { dg-do run { target c++17 } }
int
main ()
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int
f ()
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void
f ()
-// { dg-do run }
-// { dg-options "-std=c++17 -Wno-deprecated" }
+// { dg-do run { target c++17 } }
+// { dg-options "-Wno-deprecated" }
// { dg-require-weak "" }
// { dg-additional-sources "inline-var1a.C" }
-// { dg-do compile }
-// { dg-options "-std=c++17 -Wno-deprecated -g" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-Wno-deprecated -g" }
#include "inline-var1.h"
// PR c++/82782
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <const auto& Value>
struct make_char_sequence;
// PR c++/84925
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
template <typename>
struct A {
// PR c++/80767
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename... Fs>
struct overloader : Fs...
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct S {
int i;
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
namespace A __attribute ((visibility ("default"))) {}
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
// { dg-additional-options "-pedantic" }
namespace B [[deprecated]] {} // { dg-warning "ignored|must precede" }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
namespace A::B::C
{
/* nodiscard attribute tests, adapted from gcc.dg/attr-warn-unused-result.c. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++17 -O -ftrack-macro-expansion=0" } */
+/* { dg-do compile { target c++17 } } */
+/* { dg-options "-O -ftrack-macro-expansion=0" } */
#define WUR [[nodiscard]]
#define WURAI [[nodiscard, gnu::always_inline]] inline
// Testcase from P0012r1
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void (*p)() throw(int); // { dg-error "dynamic exception specification" }
void (**pp)() noexcept = &p; // { dg-error "" } cannot convert to pointer to noexcept function
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class R, class... A, bool B>
void f(R (*)(A...) noexcept(B)) { }
// PR c++/80384
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<class> struct foo;
template<bool B>
// PR c++/80614
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T> void fn() {}
// PR c++/80465
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
int foo(...);
int main() {
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
template<typename T>
struct S;
// Test for function pointer conversion on template arguments.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <void (*P)()> struct A { };
-void f() noexcept { };
+void f() noexcept { }
constexpr void (*p)() noexcept = f;
A<f> a;
// Test for overload resolution.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void f(void (*)() noexcept) = delete;
void f(void (*)()) { }
// Test for deduction.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class R, class... A>
void f(R (*)(A...));
// Test for composite pointer type.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
typedef void (*P)();
typedef void (*NP)() noexcept;
// Test for lambda conversion.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void f()
{
// Test for static_cast.
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
void f()
{
// Test for exception handling.
-// { dg-options -std=c++17 }
-// { dg-do run }
+// { dg-do run { target c++17 } }
void f() {}
void g() noexcept {}
// Test for PMF template args.
-// { dg-options -std=c++17 }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
struct A
{
// Testcase from P0127R2
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <long n> struct A { };
// PR c++/80096
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<auto> struct A
{
// PR c++/79092
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<auto V> struct val {};
// PR c++/82331
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <auto>
class X;
// PR c++/82231
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<int>
struct x {};
// Testcase from P0127R2
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <typename T> struct S;
template <typename T, T n> struct S<int[n]> {
// Testcase from P0127R2
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<auto n> struct B { decltype(n) f = n; };
B<5> b1; // OK: template parameter type is int
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T, T n> void f(T, int (&)[n]);
template <class T, T n> void g(int (&)[n], T);
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T> struct A
{
// PR c++/78334
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <auto> auto constexpr_string([](auto) {});
-void foo() { constexpr_string<0>(0); };
+void foo() { constexpr_string<0>(0); }
// PR c++/79549
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <auto...>
struct meow;
// PR c++/79556
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <auto> struct A;
template <auto...> struct B;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct S { int m; static int s; } s;
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
#include <typeinfo>
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
#ifndef __cpp_nontype_template_args
#error __cpp_nontype_template_args not defined
// PR c++/78771
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
// ICE instantiating a deleted inherited ctor
// PR c++/79143
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
struct base {
base (int, int) {}
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
template <typename a, a> struct b;
template <typename c> struct b<bool, c::d>; // { dg-error "template parameter" }
// PR c++/83020
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
struct NoDefault {
int val = 1234;
// PR c++/83644
-// { dg-do compile }
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
namespace std {
template <typename> bool is_invocable_v;
// PR c++/83918
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
constexpr unsigned
foo (unsigned x, unsigned y)
// PR c++/84325
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
struct seconds { int i_{0}; constexpr seconds (int) {} };
template <char... _Digits> constexpr seconds operator""_s() {
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
enum E { e, e }; // { dg-error "redefinition" }
// P0184R0: Generalizing the Range-Based For Loop
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
struct A {
int ar[4];
// PR c++/67114
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
typedef unsigned uint32_t;
class A {
// PR c++/67142
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
namespace detail {
template <int> int split_at;
// PR c++/84582
-// { dg-options -std=c++17 }
+// { dg-do compile { target c++17 } }
class C {
static inline const long b = 0;
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template <class T>
struct A
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
template<typename T>
struct is_float
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
constexpr int
operator""_foo(char c)
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
#ifndef __cpp_unicode_characters
#error __cpp_unicode_characters not defined
-/* { dg-do compile } */
-/* { dg-options "-std=c++17" } */
+/* { dg-do compile { target c++17 } } */
const static char c0 = u8''; // { dg-error "empty character" }
const static char c1 = u8'ab'; // { dg-warning "multi-character character constant" }
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
#include <cassert>
#include <experimental/type_traits>
// P0806R2
-// { dg-do compile }
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "" }
struct X {
int x;
-// { dg-do compile }
-// { dg-options "-O -std=c++17 -g -dA -gno-strict-dwarf" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-O -g -dA -gno-strict-dwarf" }
// { dg-require-weak "" }
// { dg-final { scan-assembler-times "0x3\[^\n\r]* DW_AT_inline" 6 { xfail *-*-aix* } } }
// { dg-final { scan-assembler-times "0x1\[^\n\r]* DW_AT_inline" 2 { xfail *-*-aix* } } }
-// { dg-do compile }
-// { dg-options "-O -std=c++17 -gdwarf-5 -dA -gno-strict-dwarf" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-O -gdwarf-5 -dA -gno-strict-dwarf" }
// { dg-require-weak "" }
// { dg-final { scan-assembler-not "DW_TAG_member" { xfail *-*-aix* } } }
// PR debug/80234
-// { dg-do compile }
-// { dg-options "-gdwarf-4 -std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-gdwarf-4" }
struct S
{
// PR debug/80234
-// { dg-do compile }
-// { dg-options "-gdwarf-5 -std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-gdwarf-5" }
struct S
{
-// { dg-additional-options -std=c++17 }
+// { dg-do compile { target c++17 } }
template<int ... Ns> int f() { return (Ns + ...); }
template<int N> int g() {
// PR c++/84556
-// { dg-do compile }
-// { dg-options "-std=c++17 -fopenmp-simd" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fopenmp-simd" }
void
foo ()
-// { dg-do compile }
-// { dg-options "-O2 -std=c++17 -fdump-tree-eipa_sra" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-O2 -fdump-tree-eipa_sra" }
#include <type_traits>
-// { dg-do compile }
-// { dg-options "-O2 -std=c++17 -fno-exceptions" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-O2 -fno-exceptions" }
// { dg-additional-options "-Wno-return-type" }
template <class a> struct b { typedef a *c; };
// PR c++/82836
-// { dg-options "-std=c++17" }
+// { dg-do compile { target c++17 } }
// { dg-require-effective-target int128 }
// { dg-require-effective-target __float128 }
// { dg-additional-options "-Wno-pedantic -Wno-return-type" }
// PR sanitizer/79589
-// { dg-do compile }
-// { dg-options "-fsanitize=undefined -std=c++17" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fsanitize=undefined" }
struct A { char a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r; } a[64];
if { [llength $gpp_std_list] > 0 } {
set std_list $gpp_std_list
} else {
- set std_list { 98 11 14 }
+ set std_list { 98 14 17 }
}
set option_list { }
foreach x $std_list {