* lib/g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.
* lib/target-supports.exp (check_effective_target_c++11): Now
means C++11 and up.
(check_effective_target_c++11_only): New.
(check_effective_target_c++11_down): New.
(check_effective_target_c++1y): New.
(check_effective_target_c++1y_only): New.
(check_effective_target_c++98_only): Rename from
check_effective_target_c++98.
* g++.dg/*: Use { target c++11 } instead of -std=c++11.
From-SVN: r208416
+2014-03-07 Jason Merrill <jason@redhat.com>
+
+ * lib/g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.
+ * lib/target-supports.exp (check_effective_target_c++11): Now
+ means C++11 and up.
+ (check_effective_target_c++11_only): New.
+ (check_effective_target_c++11_down): New.
+ (check_effective_target_c++1y): New.
+ (check_effective_target_c++1y_only): New.
+ (check_effective_target_c++98_only): Rename from
+ check_effective_target_c++98.
+ * g++.dg/*: Use { target c++11 } instead of -std=c++11.
+
2014-03-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58609
typedef enum { X, Y } A;
typedef struct { } B;
struct C {
- // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn1ENS0_1BE" { target { ! c++98 } } } }
+ // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn1ENS0_1BE" { target c++11 } } }
static void fn1 (B) { }
- // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn2ES1_" { target { ! c++98 } } } }
+ // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N11D1C3fn2ES1_" { target c++11 } } }
static void fn2 (C) { }
};
} D;
typedef enum { X, Y } A;
typedef struct { } B;
struct C {
- // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn1ENS0_1BE" { target { ! c++98 } } } }
- static void fn1 (B) { } // { dg-error "no linkage" "" { target c++98 } }
- // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn2ES1_" { target { ! c++98 } } } }
- static void fn2 (C) { } // { dg-error "no linkage" "" { target c++98 } }
+ // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn1ENS0_1BE" { target c++11 } } }
+ static void fn1 (B) { } // { dg-error "no linkage" "" { target { ! c++11 } } }
+ // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N23._31C3fn2ES1_" { target c++11 } } }
+ static void fn2 (C) { } // { dg-error "no linkage" "" { target { ! c++11 } } }
};
} const D;
typedef enum { X, Y } A;
typedef struct { } B;
template <class T> struct C {
- // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn1ENS0_1BE" { target { ! c++98 } } } }
+ // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn1ENS0_1BE" { target c++11 } } }
static void fn1 (B) { }
- // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn2ES2_" { target { ! c++98 } } } }
+ // { dg-final { scan-assembler ".weak\(_definition\)?\[ \t\]_?_ZN2N31D1CIiE3fn2ES2_" { target c++11 } } }
static void fn2 (C) { }
};
} D;
typedef enum { X, Y } A;
typedef struct { } B;
template <class T> struct C {
- // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn1ENS0_1BE" { target { ! c++98 } } } }
- static void fn1 (B) { } // { not-dg-error "no linkage" "" { target c++98 } }
- // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn2ES2_" { target { ! c++98 } } } }
- static void fn2 (C) { } // { not-dg-error "no linkage" "" { target c++98 } }
+ // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn1ENS0_1BE" { target c++11 } } }
+ static void fn1 (B) { } // { not-dg-error "no linkage" "" { target { ! c++11 } } }
+ // { dg-final { scan-assembler-not ".weak\(_definition\)?\[ \t\]_?_ZN2N43._91CIiE3fn2ES2_" { target c++11 } } }
+ static void fn2 (C) { } // { not-dg-error "no linkage" "" { target { ! c++11 } } }
};
} const D;
// namespace-scope unnamed types have no linkage, so we only test that they
// are distinct.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
typedef struct { } *A;
typedef struct { } *B;
struct C
{
typedef struct { }* D;
- typedef enum { }* E;
+ typedef enum { e }* E;
};
// { dg-final { scan-assembler "_Z2g1PN1CUt_E" } }
inline void j()
{
- typedef enum { }* F;
+ typedef enum { f }* F;
// { dg-final { scan-assembler "_Z2h1IPZ1jvEUt_EvT_" } }
h1(F());
typedef struct { }* G;
// Testcase for mangling of expressions involving operator names.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_Z1fI1AEDTclonplfp_fp_EET_" } }
// { dg-final { scan-assembler "_Z1gI1AEDTclonplIT_Efp_fp_EES1_" } }
// { dg-final { scan-assembler "_Z1hI1AEDTcldtfp_miEET_" } }
// PR c++/42338
-// { dg-options "-std=c++0x -fabi-version=5" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=5" }
// { dg-final { scan-assembler "_Z1fIPiEDTcmppfp_Li0EET_" } }
// { dg-final { scan-assembler "_Z1gIiEvRK1AIT_EDTixfL0p_Li0EE" } }
// Origin: PR c++/43375
// { dg-do compile { target i?86-*-* x86_64-*-* } }
-// { dg-options "-msse2 -std=gnu++0x" }
+// { dg-require-effective-target c++11 }
+// { dg-options "-msse2" }
// { dg-require-effective-target sse2 }
typedef float __v4sf __attribute__ ((__vector_size__ (16)));
// Testcase for mangling of parameters used other than in a trailing return type
-// { dg-options "-std=c++0x -fabi-version=5" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=5" }
template<class T> void f(T p, decltype(p)) { } // L = 1
template<class T> void g(T p, decltype(p) (*)()) { } // L = 1
// PR c++/47132
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_Z1fIiEDToRfp_Li1EET_" } }
template <typename T>
// Testcase for 'this' mangling
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct B
{
// PR c++/49932
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
template < typename T >
auto
// DR 342, PR c++/48582
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct A;
template < void * = nullptr > void f() { }
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
void* operator new (__SIZE_TYPE__, void *p) { return p; }
int i;
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
bool b;
// { dg-final { scan-assembler "_Z1fIiEDTquL_Z1bEfp_twLi42EET_" } }
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
int i;
// { dg-final { scan-assembler "_Z2f1IiEDTppfp_ET_" } }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A { int i; };
// { dg-final { scan-assembler "_Z2f1Ii1AEDTdsfp_fp0_ET0_MS2_T_" } }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template <class T> T g(T t1, T t2) { return t2; }
// { dg-final { scan-assembler "_Z2f1IiEDTcl1gfp_ilEEET_" } }
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
template<typename T> int cmp1(T a, T b);
int cmp2(char a, char b);
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
template<typename T, int (*cmp)(T, T)> struct A { };
struct B {
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
// { dg-final { scan-assembler "_Z1fIiEDTcmdlfp_psfp_EPT_" } }
template <class T> auto f (T* p) -> decltype(delete p, +p) { return p; }
// PR c++/29911 (9381)
-// { dg-options -std=c++0x }
// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target c++11 }
extern "C" int printf(const char *, ...);
-/* { dg-do compile } */
-/* { dg-options "-fcilkplus -std=c++11 " } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-fcilkplus" } */
int main (void)
{
/* { dg-options "-fcilkplus" } */
/* { dg-do run { target i?86-*-* x86_64-*-* arm*-*-* } } */
-/* { dg-options "-std=c++11 -fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* arm*-*-* } } } */
+// { dg-require-effective-target c++11 }
+/* { dg-options "-fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* arm*-*-* } } } */
#define FIRST_NUMBER 5
#define SECOND_NUMBER 3
#define HAVE_IO 0
/* { dg-options "-fcilkplus" } */
/* { dg-do run { target i?86-*-* x86_64-*-* arm*-*-* } } */
-/* { dg-options "-std=c++11 -fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* arm*-*-* } } } */
+// { dg-require-effective-target c++11 }
+/* { dg-options "-fcilkplus -lcilkrts" { target { i?86-*-* x86_64-*-* arm*-*-* } } } */
#define FIRST_NUMBER 5
#define SECOND_NUMBER 3
// PR c++/46670
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
extern unsigned char __TBB_ReverseByte(unsigned char src);
extern unsigned char *reversed;
// PR preprocessor/57757
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#define S(x) x
extern S("C")void exit (int);
// PR preprocessor/57757
-// { dg-do compile }
-// { dg-options "-std=c++11 -save-temps" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-save-temps" }
// { dg-final cleanup-saved-temps }
#define S(x) x
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
-// { dg-options "-std=c++0x -fextended-identifiers" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fextended-identifiers" }
int main()
{
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Make sure -Wliteral-suffix is enabled by default and
// triggers as expected.
// PR c++/57211
-// { dg-options "-std=c++11 -Wunused-parameter" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-parameter" }
template <class T> T&& move(T&);
-// { dg-options "-std=c++11 -Wzero-as-null-pointer-constant" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wzero-as-null-pointer-constant" }
struct A;
// PR c++/56373
-// { dg-options "-std=c++11 -Wzero-as-null-pointer-constant" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wzero-as-null-pointer-constant" }
struct shared_ptr
{
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
const char* foo()
{
// PR c++/49042
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
class A
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<class> class TT> struct X { };
template<class> struct Y { };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// These also represent tests for printing alias declarations and
// their instantiations.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class T> using Ptr = T*;
Ptr<unsigned>; // { dg-error "does not declare anything" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
namespace N
{
template <class T> using U = T*;
-};
+}
void f(N::U<int>) { blah; } // { dg-error "void f(N::U<int>)|not declared" }
// Origin: PR c++/51027
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
using INT = int // { dg-error "expected|;|at end of input" }
// Origin PR c++/51191
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template< class T >
class ClassTemplate {};
// Origin: PR c++/51145
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {};
// Origin PR c++/51194
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class U, class V> //#1
struct foo {};
// Origin PR c++/51143
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
using A0 = struct B0 { void f() {} };
// Origin PR c++/51289
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename a, template <typename, typename> class b>
struct foo {
// Origin: PR c++/51541
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename Z> using ::T = void(int n); // { dg-error "" }
template<typename Z> using operator int = void(int n); // { dg-error "" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T> struct S0 {};
template<class T> using AS0 = S0<T>;
// PR c++/54859
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<unsigned N>
using Num = int;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Exercise some member alias templates ...
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// [temp.alias]/3:
// The type-id in an alias template declaration shall not refer
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// alias template of a partial specialization
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Alias template of non-class types.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Add arguments to unbound template template parameter.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {
template <class U> using C = U;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class T>
struct A {
// Origin: PR c++/51032
// { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* nios2-*-* } { "*" } { "" } }
-// { dg-options "-std=c++11 -gstabs+" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-gstabs+" }
template <class C>
struct A {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int main(void)
{
static_assert(alignof(int) == __alignof(int), "alignof(int) does not equal __alignof(int)");
-// { dg-do compile }
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
int main(void)
{
alignof(int); //ok with a type but not with an expression
-// { dg-do compile }
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
int main(void)
{
alignof(void (void)); // { dg-warning "function type" }
// PR c++/51316
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int main()
{
+// { dg-do compile { target c++11 } }
// { dg-options "-std=c++98 -Wc++11-compat" }
// Test warning for use of auto in C++98 mode with C++11
// Positive test for auto
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <typeinfo>
extern "C" void abort();
// PR c++/38256
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A
{
// PR c++/40306, c++/40307
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
template< typename T >
struct test {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template< typename Fn > struct function;
// PR c++/40619
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename U> struct X {};
// PR c++/42567
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename B>
struct A {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void f()
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Explicit {
Explicit() = default; // Line 2
// Positive test for auto
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <typeinfo>
extern "C" void abort();
// Test for proper non-deduced context handling of the initializer
// for an auto declaration/new.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct with_apply
{
// Origin PR c++/47208
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
constexpr auto list = { }; // { dg-error "deducing from brace-enclosed initializer list requires #include <initializer_list>" }
static const int l = list.size();
// PR c++/47999
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int& identity(int& i)
{
// PR c++/46245
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<auto f()->int> struct A { };
// PR c++/48599
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
int v[1];
auto (*p)[1] = &v; // { dg-error "array of .auto" }
// PR c++/42056
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<int> struct A
{
// PR c++/43321
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
void f(T t)
// PR c++/51186
-auto main()->int // { dg-error "std=" "std" { target c++98 } }
- // { dg-error "auto" "auto" { target c++98 } 3 }
- // { dg-error "no type" "no type" { target c++98 } 3 }
+auto main()->int // { dg-error "std=" "std" { target { ! c++11 } } }
+ // { dg-error "auto" "auto" { target { ! c++11 } } 3 }
+ // { dg-error "no type" "no type" { target { ! c++11 } } 3 }
{ }
// PR c++/51404
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int i = auto().x; // { dg-error "invalid use of" }
// PR c++/51401
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <int>
struct A
// CWG issue 625
A<auto> A2 = A1; // { dg-error "" }
-auto foo() { } // { dg-error "auto" }
+auto foo() { } // { dg-error "auto" "" { target { ! c++1y } } }
void bar(auto i) // { dg-error "incomplete|auto" }
{
// Origin PR c++/51473
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/54903
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<int N, int D>
struct Modulus
// Testcase for deduction of std::initializer_list for auto.
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <typeinfo>
#include <initializer_list>
// PR c++/58550
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
-auto foo(); // { dg-error "auto" }
-auto fp = foo;
+auto foo(); // { dg-error "auto" "" { target { ! c++1y } } }
+auto fp = foo; // { dg-error "auto" "" { target c++1y } }
// Testcase for non-dependent auto in templates
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/37965
// Negative test for auto
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
auto i = 6;
auto j; // { dg-error "has no initializer" }
// PR c++/37962
// Negative test for auto
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <typeinfo>
#include <stdarg.h>
struct A
{
- operator auto (); // { dg-error "auto" }
- operator auto *(); // { dg-error "auto" }
+ operator auto (); // { dg-error "auto" "" { target { ! c++1y } } }
+ operator auto *(); // { dg-error "auto" "" { target { ! c++1y } } }
};
struct A2
{
- operator auto () -> int; // { dg-error "invalid use of" }
+ operator auto () -> int; // { dg-error "invalid use of" "" { target { ! c++1y } } }
operator auto *() -> int; // { dg-error "auto" }
};
void
foo ()
{
- (auto) { 0 }; // { dg-error "auto" }
+ __extension__ (auto) { 0 }; // { dg-error "auto" }
C<int> c;
dynamic_cast<auto> (c); // { dg-error "auto" }
reinterpret_cast<auto> (c); // { dg-error "auto" }
void
bar ()
{
- try { } catch (auto i) { } // { dg-error "parameter declared" }
- try { } catch (auto) { } // { dg-error "parameter declared" }
- try { } catch (auto *i) { } // { dg-error "parameter declared" }
- try { } catch (auto *) { } // { dg-error "parameter declared" }
+ try { } catch (auto i) { } // { dg-error "parameter" }
+ try { } catch (auto) { } // { dg-error "parameter" }
+ try { } catch (auto *i) { } // { dg-error "parameter" }
+ try { } catch (auto *) { } // { dg-error "parameter" }
}
void
template <typename T = auto> struct E {}; // { dg-error "invalid use of" }
template <class T = auto *> struct F {}; // { dg-error "invalid use of|expected" }
-auto fnlate () -> auto; // { dg-error "invalid use of" }
-auto fnlate2 () -> auto *; // { dg-error "invalid use of|expected" }
+auto fnlate () -> auto; // { dg-error "invalid use of" "" { target { ! c++1y } } }
+auto fnlate2 () -> auto *; // { dg-error "invalid use of|expected" "" { target { ! c++1y } } }
void
badthrow () throw (auto) // { dg-error "invalid use of" }
template <typename T> struct H { H (); ~H (); };
H<auto> h; // { dg-error "invalid" }
-void qq (auto); // { dg-warning "auto" }
-void qr (auto*); // { dg-warning "auto" }
+void qq (auto); // { dg-error "auto" }
+void qr (auto*); // { dg-error "auto" }
// PR c++/46145
typedef auto autot; // { dg-error "auto" }
// Test for throwing bad_array_new_length on invalid array length
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <new>
// Test for throwing bad_array_new_length on invalid array length
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <new>
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
struct S{};
void f(S&&);
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T>
struct list {};
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int i> class X { /* ... */ };
X< 1>2 > x1; // // { dg-error "numeric constant" }
+// { dg-do compile { target c++11 } }
// { dg-options "-std=c++98 -Wc++11-compat" }
template<int N> struct X {};
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T>
struct vector {
};
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
struct S
{
S();
// Test cast from lvalue to rvalue
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
// PR c++/46336
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern "C" {
enum A { };
// PR c++/46420
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename> class vector { };
struct A{};
// PR c++/47570
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
unsigned int constexpr one()
{ return 1; }
// PR c++/47969
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/48089
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// bang is ill-formed (diagnostic required) because its initializer is
// non-constant, because it uses the value of an uninitialized object.
// PR c++/49776
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct s
{
// PR c++/51369
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
constexpr int x[2][2] = {};
// PR c++/52672
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
__extension__ typedef __SIZE_TYPE__ * ul_ptr;
constexpr unsigned long a = *((ul_ptr)0x0); // { dg-error "" }
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
typedef float __attribute__ ((vector_size (4 * sizeof (float)))) V4;
constexpr V4 v = { 1, 1, 1, 0 };
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// Ignore warning on some powerpc-ibm-aix configurations.
// { dg-prune-output "non-standard ABI extension" }
// { dg-prune-output "changes the ABI" }
typedef float __attribute__ ((vector_size (4 * sizeof (float)))) V4;
-constexpr V4 build (float x, float y, float z) { return (V4){ x, y, z, 0 };}
+constexpr V4 build (float x, float y, float z) { return __extension__ (V4){ x, y, z, 0 };}
constexpr V4 x = build (1, 0, 0);
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
// Ignore warning on some powerpc-ibm-aix configurations.
// { dg-prune-output "non-standard ABI extension" }
// PR c++/55573
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
// Ignore warning on some powerpc-ibm-aix configurations.
// { dg-prune-output "non-standard ABI extension" }
// PR c++/56302
-// { dg-do compile }
-// { dg-options "-std=c++11 -O0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O0" }
constexpr int foo () { return 42; }
constexpr int x = foo () + 2;
// Origin PR c++/51462
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/47301
-// { dg-options "-std=c++11 -fabi-version=1" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=1" }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class base
{
// PR c++/56481
// Non-linearity in potential_constant_expression_1
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
constexpr T do_get(T* x, int n) {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct IsNegative {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr bool is_negative(int x) {
return x < 0;
-};
+}
constexpr bool do_has_neg(const int* x, bool(*p)(int)) {
return p(x[0]) || p(x[1]); // Line 6
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr const int do_last(const int* x, int n) {
return x[n - 1];
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
constexpr T do_last(T* x, int n) {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef decltype(sizeof(char)) size_type;
// PR c++/49290
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef unsigned T;
struct S
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <const int I[2]> struct A { int ir[I[0]]; };
extern constexpr int ar[2] = { 1, 2 };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler-not "static_initialization" } }
struct A
// PR c++/46348
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<__SIZE_TYPE__ _Nw>
struct _Base
// PR c++/48132
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct C
{
// PR c++/49924
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { constexpr A() { } };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
//A few constexpr's
constexpr int foo() { return __alignof__(int); }
// { dg-do compile { target init_priority } }
-// { dg-options -std=gnu++11 }
+// { dg-require-effective-target c++11 }
struct t { t(); };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr auto value = 0;
// Test base/member class and static_assert with constexpr
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
int i;
// PR c++/46293
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/46526
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
struct Base
{
// PR c++/46626
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/46369
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/49136
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct day
{
// PR c++/49136
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct S
{
// PR c++/49813
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
inline constexpr bool
isinf(long double __x)
// PR c++/51433
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int f();
constexpr int g() { return f(); }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Make sure C99 complex works with constexpr
-// { dg-options -std=gnu++11 }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
struct complex
{
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
constexpr int f()
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// Core DR 948
constexpr int something() { return 3; }
// PR c++/48909
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert((X),#X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/52599
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct foo {
- constexpr foo() try { } catch(...) { }; // { dg-error "constructor" }
+ constexpr foo() try { } catch(...) { }; // { dg-error "constexpr" }
};
// PR c++/55856
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
struct B
{
T t;
- template <class U> constexpr B(U&& u): t(u) { };
+ template <class U> constexpr B(U&& u): t(u) { }
};
B<A&&> b("");
// PR c++/55753
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename Tp>
struct C {
// PR c++/55753
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/46348
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/46873
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S
{
// PR c++/46877
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct new_allocator
{
// PR c++/47041
-// { dg-options "-std=c++11 -fno-elide-constructors" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-elide-constructors" }
struct S
{
// PR c++/47199
-// { dg-options "-std=c++11 -fno-elide-constructors" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-elide-constructors" }
template < int > struct S
{
// PR c++/46466
-// { dg-options "-std=c++11 -fno-elide-constructors" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-elide-constructors" }
struct S { bool b; };
constexpr S f() { return S{true}; }
// PR c++/47774
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename _Tp, _Tp v>
struct A3
// PR c++/46930
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S {
static constexpr int size; // { dg-error "must have an initializer" "must have" }
// PR c++/46335
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct T { };
struct A {
// PR c++/46368
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class A;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
int i;
// PR c++/51526
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
const int j = 42;
// PR c++/51723
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <int... V>
struct A
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr bool never() = delete; // useless, but OK
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Test that we explain why a template instantiation isn't constexpr
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct A
// PR c++/47207
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int X (X); // { dg-error "not usable" }
// { dg-message "own initializer" "" { target *-*-* } 4 }
// PR c++/45923
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int f(int);
// Origin: PR c++/51633
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// Origin: PR c++/51633
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T> class my_limits {
public:
static constexpr T min() throw() { return T(); }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int ellipsis(...) { return 1; }
constexpr int ellipsis_c = ellipsis(); // OK
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Empty {};
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct IsLiteral {};
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct IsLiteral {};
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef decltype(sizeof(char)) size_type;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { };
struct B: A { };
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-options "-std=c++11 -ftrack-macro-expansion=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-ftrack-macro-expansion=0" }
#define SA(X) static_assert (X, #X)
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// Error: Explicit instantiation of a function template shall not use the
// inline or constexpr specifiers
template<class T> constexpr inline T bar(T x) { return x; }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T> constexpr inline T bar(T x) { return x; }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr bool is_negative(int x) { return x < 0; }
// PR c++/48948
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { A(); };
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> struct A
{
// We used to crash on this instead of giving a decent error.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { int i; };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int x;
constexpr int& rx = x;
// PR c++/46289
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/51612
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {};
// PR c++/51621
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/51327
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// A constructor that might or might not be constexpr still makes
// its class literal.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct B
// PR c++/49015
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class A;
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
namespace xstd {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
#define SA(X) static_assert(X,#X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { int i; };
struct B: A { constexpr B(): A{} {} };
// PR c++/50024
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template< class T >
struct Container
// PR c++/55419
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct P
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <type_traits>
// PR c++/48296
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct X
{
// PR c++/48911
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert((X),#X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Negative examples from N3092 (FCD)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// OK: declaration
constexpr int square(int x); // { dg-message "never defined" }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct is_funny {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
constexpr T value(T t) { return t; }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int f(int i) { return i; }
#define SA(X) static_assert (X, #X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// A call is noexcept if it is a valid subexpression of a constant
// expression, even if it is not itself a constant expression.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct booleable {
bool data;
// PR c++/51305
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr bool ok() noexcept
{
// Example from issue 1125 drafting; D() and v were well-formed with the
// wording approved in Rapperswil, now seems they should be ill-formed.
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
struct B {
constexpr B(int x) : i(0) { } // "x" is unused
// PR c++/47200
-// { dg-options "-std=c++11 -w" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-w" }
template < int > struct duration
{
// PR c++/49988
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
template<int ... I> struct X { };
// FIXME this is currently invalid, but seems like it should be OK
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { A() { } };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int zero() { return 0; }
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// From N2235
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
constexpr int verysquare(int x) { return x * x; }
-// { dg-options "-std=c++11 -w -ftrack-macro-expansion=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-w -ftrack-macro-expansion=0" }
#include <limits.h>
extern constexpr int max_s = INT_MAX + 1; // { dg-error "" }
// PR c++/47504
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
char constexpr sub(char arg)
{ return char(arg - char(1)); }
// The FCD doesn't allow typedefs and static_assert in constexpr functions,
// but it should.
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
template <class T>
constexpr T f(T t)
// Positive examples from N3092 (FCD)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert(X, #X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// We decided in Rapperswil that it's OK if any value of decide can produce
// a constant expression.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct C { // literal type
int m;
// PR c++/51489
// DR 1313
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct array
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Test that we catch excessive recursion.
-// { dg-options "-std=c++11 -fconstexpr-depth=5" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fconstexpr-depth=5" }
// { dg-prune-output "in constexpr expansion" }
constexpr int f (int i) { return f (i-1); }
constexpr int i = f(42); // { dg-error "constexpr evaluation depth" }
// PR c++/49172
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert((X),#X)
-constexpr int g() { return 42; };
+constexpr int g() { return 42; }
constexpr int(&rg)() = g; // #1
SA(rg() == 42);
// Negative reference variable tests.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern int *p;
constexpr int& ri = *p; // { dg-error "p" }
// PR c++/50298
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int global_variable;
// PR c++/54777
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S
{
// PR c++/49673: check that test_data goes into .rodata
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-additional-options -G0 { target { { alpha*-*-* frv*-*-* ia64-*-* lm32*-*-* m32r*-*-* microblaze*-*-* mips*-*-* nios2-*-* powerpc*-*-* rs6000*-*-* score*-*-* } && { ! { *-*-darwin* *-*-aix* alpha*-*-*vms* } } } } }
// { dg-final { scan-assembler "\\.rdata" { target mips*-*-* } } }
// { dg-final { scan-assembler "rodata" { target { { *-*-linux-gnu *-*-gnu* *-*-elf } && { ! mips*-*-* } } } } }
// Allow static_assert in constexpr constructors, too.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T>
struct A
// PR c++/56871
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T> constexpr int foo(T);
template<> int foo(int);
// Test for constant initialization of non-literal class (e.g. mutex)
-// { dg-options "-std=c++11 -save-temps" }
-// { dg-do run }
+// { dg-options "-save-temps" }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/55944
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct Test
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct IsLiteral {};
struct ShouldBeLiteral {
// Test for constant initialization of class with vtable
-// { dg-options "-std=c++11 -save-temps" }
+// { dg-options "-save-temps" }
// { dg-final { scan-assembler-not "static_initialization" } }
// { dg-final cleanup-saved-temps }
-// { dg-do run }
+// { dg-do run { target c++11 } }
int r = 1;
// implicit default constructor for A and B is constexpr
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
extern "C" void abort ();
extern int ar[2];
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct A
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct B
{
// PR c++/48945
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
static constexpr bool is();
// PR c++/50258
-// { dg-options "-std=c++11 -fpermissive" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fpermissive" }
struct Foo {
static const double d = 3.14; // { dg-warning "constexpr" }
// PR c++/46977
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template < typename > void
foo ()
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr char c1 = "hi"[1];
constexpr char c2 = "hi"[2];
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
constexpr T value(T t = T()) { return t; }
// Test for constexpr conversion in case context
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class E { e1, e2 };
// PR c++/46472
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T> struct A {
T t;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/50248, DR 1358
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class Elt, unsigned max>
struct earray
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { constexpr operator int() { return 42; } };
// PR c++/59268
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename>
struct A
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr int may_throw(bool decide) {
return decide ? 42 : throw -1; // { dg-error "throw" }
// PR c++/50508
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct integral_constant {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <typeinfo>
// Test that we don't have to deal with type punning
// DR 1188 says this is ill-formed
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
union U
{
// PR c++/51675
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
union foo
{
// PR c++/51675
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
union foo
{
// PR c++/54922
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
#define SA(X) static_assert(X,#X)
// Core issue 898
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace N { const int i = 42; }
namespace M { const int j = 42; }
// PR c++/49520
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace x { void foo(); }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct HopefullyLiteral {
HopefullyLiteral() = default; // Should be a constexpr c'tor as of 12.1/6 and 8.4.2/4
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
constexpr T value_init() { return T(); }
// PR c++/50234
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert((X),#X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class... T>
constexpr bool variadics(T&&...) { return true; }
// PR c++/47067
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct X {
virtual void x();
// PR c++/56291
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class Base
{
// PR c++/48570
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
extern "C" void abort ();
constexpr wchar_t foo (int i) { return L"0123"[i]; }
// PR c++/48570
-// { dg-do compile }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr wchar_t c1 = L"hi"[3]; // { dg-error "out of bound" }
constexpr char16_t c2 = u"hi"[3]; // { dg-error "out of bound" }
-// { dg-do compile }
-// { dg-options --std=c++11 }
+// { dg-do compile { target c++11 } }
struct B {
int i;
-// { dg-do compile }
-// { dg-options --std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
int i, j;
-// { dg-do compile }
-// { dg-options --std=c++11 }
+// { dg-do compile { target c++11 } }
struct X {};
-// { dg-do run }
-// { dg-options "--std=c++11" }
+// { dg-do run { target c++11 } }
#include <cassert>
// Core 1212
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T, class U> struct assert_same_type;
template <class T> struct assert_same_type<T,T> {};
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// PR c++/33837
void foo()
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// PR c++/33838
template<typename T> struct A
{
-/* { dg-do compile } */
-/* { dg-options "-std=gnu++11 -Wall" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-Wall" } */
typedef float v4f __attribute__((vector_size(4*sizeof(float))));
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/33045
int && f ();
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
// PR c++/34271
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A
{
// PR c++/35316
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
{
// PR c++/38640
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int N> void foo (decltype (N));
template<long int N> void foo (decltype (N));
// PR c++/39070
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename X> struct junk {
template<typename Z> static Z y();
// PR c++/36628
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <typeinfo>
#include <string.h>
// PR c++/37875
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename> struct X {};
X<decltype(1 > 2)> x;
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
CHECK_DECLTYPE(decltype(foo), int(char));
decltype(bar) z; // { dg-error "overload" "overload" }
-// { dg-error "invalid type" "invalid" { target *-*-* } 48 }
+// { dg-error "invalid type" "invalid" { target *-*-* } 47 }
CHECK_DECLTYPE(decltype(&foo), int(*)(char));
CHECK_DECLTYPE(decltype(*&foo), int(&)(char));
// PR c++/42277
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S { int s; };
template <int N>
// PR c++/6709 (DR 743)
// PR c++/42603 (DR 950)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
T make();
// PR c++/42761
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename _Tp> _Tp* fn();
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int x, &&y = static_cast<int &&>(x);
typedef decltype((y)) myInt; // `y' is a parenthesized id-expression of type int that is an lvalue
// PR c++/47068
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> struct broken {
int member;
// PR c++/47851
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Type {
void display_type();
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { };
// PR c++/48617
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T, decltype(T())> // #
struct A {};
// PR c++/44175
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <bool, class T> struct enable_if { };
template <class T> struct enable_if <true, T> { typedef T type; };
// PR c++/44175
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <bool, class T> struct enable_if { };
template <class T> struct enable_if <true, T> { typedef T type; };
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
CHECK_DECLTYPE(decltype(aa.*&A::a), int&);
decltype(aa.*&A::b) zz; // { dg-error "cannot create pointer to reference member" "cannot" }
-// { dg-error "invalid type" "invalid type" { target *-*-* } 58 }
+// { dg-error "invalid type" "invalid type" { target *-*-* } 57 }
CHECK_DECLTYPE(decltype(caa.*&A::a), const int&);
class X {
// PR c++/49369
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class,class> struct assert_same;
template <class T> struct assert_same<T,T> {};
// PR c++/49921
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Local
{
// PR c++/50075
-// { dg-options "-std=c++11 -ftemplate-depth=10" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-ftemplate-depth=10" }
template <typename T>
auto make_array(const T& il) ->
// PR c++/50084
-// { dg-options "-std=c++11 -fno-inline" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-inline" }
template<typename> struct remove_reference;
template<typename T> struct remove_reference<T&> { typedef T type; };
// PR c++/50870
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
struct impl
{
// PR c++/50870
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class V>
struct impl
// PR c++/51265
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Funny
{
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
// PR c++/51222
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rref {
// PR c++/55564
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T, decltype(sizeof(T)) N>
auto array_size(T(&)[N]) -> decltype(N) { return N; }
// PR c++/56059
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef int Int;
template<typename T> struct baz { };
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
// PR c++/34271
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A
{
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
// Positive test for defaulted/deleted fns
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/40381
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// Core issue 901
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T>
struct NonCopyable {
// PR c++/39866
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {
A& operator=(const A&) = delete; // { dg-bogus "" }
// PR c++/38796
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert ((X), #X)
// Test that non-inline default causes the function to be defined even if
// it isn't used.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZN1AC1Ev" } }
struct A
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A // { dg-error "const|operator=" }
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void f(char i, int j) = delete; // { dg-message "<deleted>" }
void f(int i, ...); // { dg-message "void f" }
// We don't allocate a cookie to help us run the destructor if it's trivial,
// even if it's deleted.
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// We allocate a cookie to help us run the destructor if it's non-trivial,
// even if it's deleted.
-// { dg-options "-std=c++0x" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct B { ~B() {} };
struct A
// Negative test for defaulted/deleted fns.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void f(); // { dg-message "previous" }
void f() = delete; // { dg-error "deleted" }
// PR c++/46497
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
A(A&&) = default;
// PR c++/46736
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct U {
U();
// Test that a virtual defaulted constructor is still virtual.
-// { dg-do run }
-// { dg-options -std=c++11 }
+// { dg-do run { target c++11 } }
int r = 1;
// Test for checking of exception specifications on defaulted fns
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/48280
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S {
template < typename > S (const S &) = default; // { dg-error "" }
// PR c++/48930
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
struct A
// PR c++/49066
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
void foo() = delete; // { dg-message "declared here" }
void foo();
// PR c++/47544
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZN1sIiEC2Ev" } }
// { dg-final { scan-assembler-not "_ZN1sIiED2Ev" } }
// PR c++/49102
// PR c++/50034
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
A() = default;
// PR c++/46696
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/37006
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
struct A {
// PR c++/49507
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T>
struct ConcretePoolKey
// PR c++/39164
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/50531
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T>
class DataFilter
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "__cxa_deleted_virtual" } }
struct A
// PR c++/53096
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct foo
{
// DR 1402
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> T&& move(T& t);
// PR c++/37208: SFINAE and deleted functions.
-// { dg-options "-std=c++11" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template<int> struct A { };
template<typename T>
// DR 1402
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> T&& move(T& t);
// PR c++/37234
-// { dg-do link }
-// { dg-options "-std=c++11" }
+// { dg-do link { target c++11 } }
template <typename T>
class foo {
// PR c++/37906
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct b
{
// PR c++/38701, 38702
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void foo() = default; // { dg-error "cannot be defaulted" }
namespace
// PR c++/38649
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/39153
-// { dg-options "-std=c++11 -fno-inline" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-inline" }
struct _Impl_base
{
// PR c++/48319
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// We were failing to recognize declval<_Args1> as dependent.
template<typename Tp> Tp declval() noexcept;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <int U>
struct TypeA
// Test: Implicit cast to rvalue when eliding copy
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
// Core 1148: should be able to move from value parameter on return
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Test: Implicit cast to rvalue when eliding copy
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
// PR c++/38021
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
enum : { }; // { dg-error "expected" }
enum : 3 { }; // { dg-error "expected" }
// PR c++/48534
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class OpSE : bool;
// PR c++/48969
-// { dg-options "-std=c++11 -ftemplate-depth=10" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-ftemplate-depth=10" }
template<unsigned int N> struct Pair { };
struct Foo { enum { Mask = 1 }; } foo;
// PR c++/48780
-// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
// PR c++/48780
-// { dg-options "-std=c++11 -fabi-version=5 -Wabi" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=5 -Wabi" }
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
// PR c++/48106
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class E : char
{
// PR c++/44311
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class A { Val0, Val1 };
// PR c++/48935
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class ENUM { a };
// PR c++/48536
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
#include <climits>
// PR c++/47277
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int main(void) {
enum e {};
// We shouldn't give an ABI warning about promotion in switch.
-// { dg-options "-std=c++11 -fabi-version=5 -Wabi" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=5 -Wabi" }
enum class Foo { X };
void test(Foo val)
// PR c++/38637
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> enum E : int { e }; // { dg-error "declaration|expected" }
// PR c++/47635
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum A { };
void A::f() { } // { dg-error "not a class" }
-// { dg-do compile }
-// { dg-options "-pedantic -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
enum x { y, };
// PR c++/54216
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
enum {}; // { dg-warning "empty anonymous" }
// PR c++/38064
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
enum class E { elem };
// PR c++/40633
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template< typename T >
struct wrap {
// PR c++/40639
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template< typename T >
struct wrap {
// PR c++/37946
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
enum class E : char
{
// PR c++/37816
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class A
{
// PR c++/47704
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void
foo ()
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class E { };
E f();
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef unsigned volatile long long uvlonglong;
-// { dg-do run }
-// { dg-options "-O2 -Wtype-limits -std=c++11" }
+// { dg-do run { target c++11 } }
+// { dg-options "-O2 -Wtype-limits" }
extern void link_error (void);
enum Alpha : unsigned char {
// PR c++/34395
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int... N> void foo (int... x[N]) // { dg-message "int \\\[N\\\]\\.\\.\\. x" }
{
// PR c++/38656
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> int foo();
// PR c++/47336
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T>
void g(T t)
// PR c++/49156
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T> T declval();
// PR c++/49181
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std
{
// PR c++/48284
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename C>
auto g(C& c) -> decltype (c.f()) { return c.f(); } // { dg-message "decltype .c\\.f" }
// Test for printing the type of T{} in error messages.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T, T t> struct A { };
template <class T> A<T,T{}> f(T t); // { dg-message "T{}" }
// Test for explicit conversion ops from N2437.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class U; class V;
class T
// Test for explicit conversion ops in various conversion situations.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef void (*pfn)();
// Test for "contextually converted to bool"
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// Negative explicit conv test.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {
A(const A&, int = 0); // { dg-message "note" }
// test for extension of DR 899 to handle template ctors
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
int r = 1;
// PR c++/47080
-// { dg-options -std=c++11 }
+// { dg-options "" }
+// { dg-do compile { target c++11 } }
struct A {
explicit operator int(); // { dg-message "qualification conversion" }
// can be converted to type T with a qualification conversion (4.4) are
// also candidate functions.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
struct A { };
struct B: A { };
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
template <typename> void f() {}
extern template void f<int>();
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
template <typename> class S {};
extern template class S<int>;
// PR c++/37766
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int a = 1;
template<int& b = a> void f() {
// PR c++/46831
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
struct B { };
struct D : B { };
// PR c++/55724
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<int N> struct S {};
template<typename T = int, T N> void f(S<N>) {}
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// opaque enum declarations
enum class E1;
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
//This error is diagnosed at instantiation time
template<typename T> struct S1
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct S1
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
namespace S1
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T> struct S1
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
namespace one
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
enum class E1 : int; // { dg-error "previous definition" }
enum E1 : int; // { dg-error "scoped/unscoped mismatch" }
enum class E7;
enum class E7 : int; //ok
-enum class E3 e3; // { dg-warning "scoped enum must not use" }
-enum struct E3 e4; // { dg-warning "scoped enum must not use" }
+enum class E3 e3; // { dg-error "scoped enum must not use" }
+enum struct E3 e4; // { dg-error "scoped enum must not use" }
enum E5 : int e5; // { dg-error "expected|invalid type" }
enum E6 : int { a, b, c }; // { dg-error "previous definition" }
{
enum class N1::E6 { e1, e2, e3 }; // { dg-error "does not enclose" }
enum N1::E7 : int { e1, e2, e3 }; // { dg-error "does not enclose" }
-};
+}
enum class N1::E6 { e1, e2, e3 };
enum N1::E7 : int { e1, e2, e3 };
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template<typename T> struct S1
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
//This instatiation is ok
template<typename T> struct S1
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template<typename T> struct S1
{
// From N1791
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class C;
typedef C Ct;
// PR c++/47721
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// template type parameter friend:
// { dg-do compile { target i?86-*-* x86_64-*-* } }
-// { dg-options "-O3 -msse2 -std=c++11" }
+// { dg-require-effective-target c++11 }
+// { dg-options "-O3 -msse2" }
// { dg-require-effective-target sse2 }
// You can make NON-template typedefs with a large alignment.
// PR c++/43031
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-options "-pedantic" }
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } }
+// { dg-require-effective-target c++11 }
// c++11 attributes that apply to types are ignored for now
// PR c++/43093
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-options "-pedantic" }
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } }
+// { dg-require-effective-target c++11 }
// c++11 attributes that apply to types are ignored for now
-// { dg-options "-std=c++11 -Wunused -pedantic-errors" }
-// { dg-do compile }
+// { dg-options "-Wunused -pedantic-errors" }
+// { dg-do compile { target c++11 } }
// Test for syntax support of various attribute permutations.
int
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-options "-pedantic" }
// { dg-do compile { target { i?86-*-* && ilp32 } } }
+// { dg-require-effective-target c++11 }
struct A {
[[gnu::fastcall]]
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-options "-pedantic" }
// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } }
+// { dg-require-effective-target c++11 }
extern int * ([[gnu::stdcall]] *fooPtr)( void); // { dg-error "expected" }
int * [[gnu::stdcall]] myFn01( void) { return 0; }// { dg-warning "ignored" }
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
// Integer imaginary...
-// { dg-do compile }
-// { dg-options "-std=gnu++11 -fno-ext-numeric-literals" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-ext-numeric-literals" }
// Integer imaginary...
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
struct S
{
S();
// PR c++/46807
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
// even though doing overload resolution would mean calling the template
// constructor. In C++11, we do overload resolution to determine triviality.
// Test for implicitly deleted destructors.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "default definition would be ill-formed" }
// { dg-prune-output "within this context" }
// PR c++/46103
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct MoveOnly {
MoveOnly(const MoveOnly&) = delete;
// Test that we consider base dtors in determining whether
// a derived ctor is deleted even if the ctor is trivial.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/50500
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// If a class declares move operations, the implicitly declared copy
// operations are deleted.
// Test that the synthesized C copy constructor calls the A template
// constructor and has the appropriate exception specification.
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
int r = 1;
// Basic runtime test for implicit move constructor
-// { dg-do run }
-// { dg-options -std=c++11 }
+// { dg-do run { target c++11 } }
int m;
// Test that a base with only a move constructor causes the implicit copy
// constructor to be deleted.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A // { dg-message "declares a move" }
{
// Test that the default B copy constructor calls the deleted A
// copy constructor.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A // { dg-message "declares a move" }
{
// Circular implicit declarations were causing errors
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Ray;
// PR c++/44909
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// Declaring A<D<E>>'s copy ctor means choosing a ctor to initialize D<E>,
// which means choosing a ctor for C<B<E>>, which meant considering
// C(const B<E>&) which means choosing a ctor for B<E>, which means choosing
// The hack for PR c++/44909 breaks this testcase. We need feedback
// from the C++ committee to know how to proceed.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Test that private base dtor makes derived ctor deleted
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options "-std=c++11 -g" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g" }
struct A
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/55261
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Discussions on the core reflector indicate that not inheriting base copy
// constructors was a deliberate choice.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { A(int); };
struct B: public A
// PR c++/56285
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct foo {
explicit foo(int&&) {}
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct B1 {
B1(int);
// From N3337
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct B1 {
B1(int);
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct B1 {
B1(int) { }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
extern "C" int printf (const char *, ...);
template< class T >
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef int IA[2];
typedef double DA[2];
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef int IRT[2];
// PR c++/52905
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// supported by the working draft, but is necessary for perfect forwarding
// of initializer-lists to things that can take a std::initializer_list.
-// { dg-options "-std=c++11 -fdeduce-init-list" }
-// { dg-do run }
+// { dg-options "-fdeduce-init-list" }
+// { dg-do run { target c++11 } }
#include <initializer_list>
-// { dg-do compile }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename _Tp>
_Tp&& declval() noexcept;
// Test that we properly extend the lifetime of the initializer_list
// array even if the initializer_list is a subobject.
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <initializer_list>
// Test that we properly extend the lifetime of the initializer_list
// array even if the initializer_list is a subobject.
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <initializer_list>
// PR c++/41997
-// { dg-options "-std=c++11 -O2 -fdump-tree-optimized" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -fdump-tree-optimized" }
// { dg-final { scan-tree-dump-not "_0" "optimized" } }
// { dg-final { cleanup-tree-dump "optimized" } }
// PR c++/51738
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct Index
{
// PR c++/54325
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class base
{
// PR c++/54325
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class Base {
public:
// Test for value-initialization via {}
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
void * operator new (__SIZE_TYPE__, void *p) { return p; }
void * operator new[] (__SIZE_TYPE__, void *p) { return p; }
// constructor but defaulted default constructor. The FDIS got this
// wrong; see c++std-core-19883.
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// Basic uses of initializer lists
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <initializer_list>
// PR c++/38380
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
namespace std
{
// PR c++/38684
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/38698
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
struct A
// PR c++/39056
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
#include <complex>
// Bug: We weren't doing the normal replacement of array with pointer
// for deduction in the context of a call because of the initializer list.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Just discard errors pointing at header files
// { dg-prune-output "include" }
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
extern "C" void abort();
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
void f(int i);
// PR c++/40308, 40311
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
template< typename T >
struct test {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Allow other errors, too
// { dg-prune-output "error" }
// Test that conversion to std::initializer_list takes priority over other
// user-defined conversions.
-// { dg-do link }
-// { dg-options "-std=c++11" }
+// { dg-do link { target c++11 } }
#include <initializer_list>
// PR c++/40689
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class X
{
// PR c++/40689
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class X
{
// Core issue 934/1288
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int i;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/39923
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/41754
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <map>
#include <string>
// PR c++/42059
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" { target { ! c++1y } } }
void
foo (int i)
// PR c++/42061
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int& i = { j }; // { dg-error "invalid initialization|was not declared" }
// PR c++/42060
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void foo()
{
// PR c++/42331
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class Mesh
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// Testcase for variadic init list deduction.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/43028
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// Test that we try normal init if no list ctor is viable.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/44045
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct base
{
// PR c++/44157
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/41510
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct B
{
void f()
{
A a = { 1, 2 };
-};
+}
template <class T> void g()
{
A a = { 1, 2 };
-};
+}
template void g<int>();
// PR c++/44358
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// DR 990
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// DR 990
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { int i; };
// Test for initializer-list 'explicit' rule
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/54835, DR 1518
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/44703
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum Unscoped { };
enum class Scoped { };
// Test that using T{} at file scope doesn't create a static temporary.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler-not "local" } }
struct A { };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/46289
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/48281
-// { dg-options "-std=c++11 -O2" }
-// { dg-do run }
+// { dg-options "-O2" }
+// { dg-do run { target c++11 } }
#include <initializer_list>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { ~A() = delete; }; // { dg-message "declared" }
// PR c++/48726
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <memory>
// Test for non-trivial list-initialization with array new.
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// Test for narrowing diagnostics
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// PR c++/45418
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A1 { };
struct A2 {
// PR c++/47184
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S
{
// PR c++/45378
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
int main()
{
// PR c++/49216
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <initializer_list>
extern "C" void abort();
// PR c++/49355
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <string>
// Test for -Wno-narrowing
-// { dg-options "-std=c++11 -pedantic-errors -Wno-narrowing" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic-errors -Wno-narrowing" }
int i;
float d = { i };
// PR c++/47453
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
// invalid
int a({0}); // { dg-error "" }
// PR c++/50054
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
void g( const int& (a)[1] ) {} // { dg-error "array of references" }
// PR c++/50209
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S { int i,j; };
// PR c++/49996
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Test for initlist lifetime
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <initializer_list>
// PR c++/51399
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// Origin PR c++/51475
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
const std::initializer_list<A>& x;
};
-B b = {{1}}; // { dg-error "invalid conversion|cannot convert" }
+B b = {{1}}; // { dg-error "" }
// PR c++/51553
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct X
{
// Core 1270
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/37932
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
typedef enum { AA=1, BB=2 } my_enum;
// PR c++/37740
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/37860
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct b
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZN1Q2V11fEv" } }
// { dg-final { scan-assembler "_ZN1Q2V11iE" } }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace Q {
inline namespace V1 {
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace C
{
// See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html under the
// section "Revision 1 Summary and Rationale" for more details.
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// PR c++/50220
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template<typename Foo> struct Foobar {};
// PR c++/44160
-// { dg-options -std=c++0x }
-// { dg-do link }
+// { dg-do link { target c++11 } }
int main()
{
// Test that array capture by copy works.
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/50437
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template <typename T>
void f()
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
#include <cassert>
int main() {
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
int main() {
// PR c++/50736
-// { dg-options "-std=c++0x -pedantic-errors" }
+// { dg-do compile { target c++11 } }
int i;
void f();
// FDIS 5.1.2/8
-// { dg-options "-pedantic-errors -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic-errors" }
struct S2 { void f(int i); };
void S2::f(int i) {
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
// PR c++/52026
-// { dg-options "-std=c++11 -O" }
-// { dg-do run }
+// { dg-options "-O" }
+// { dg-do run { target c++11 } }
template<bool B>
int func() {
// Test for conversion from stateless lambda to function pointer.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZZ1fvENKUlvE_cvPFvvEEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin *-*-hpux10* } } } } }
inline void f()
// Test for conversion from stateless lambda to function pointer.
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
typedef int (*pfn)(int);
// work properly for variadics. Make sure that we can still use the lambda
// normally.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
void f()
{
// PR c++/43641
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct B
{
// PR c++/45080
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
typedef void(*pfn)();
// PR c++/55015
-// { dg-do link }
-// { dg-options -std=c++11 }
+// { dg-do link { target c++11 } }
typedef void (*VoidFunc)();
inline VoidFunc GetFunc() { return [](){}; }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
int main() {
int i;
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
int main() {
int i;
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
int main() {
int i;
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
int main() {
int i;
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
void f()
{
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/43502
-// { dg-options "-std=c++0x -fcompare-debug" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fcompare-debug" }
void g (int n)
{
// PR c++/59791
// We force the gimple dump to trigger use of lang_decl_name.
-// { dg-options "-std=c++11 -fdump-tree-gimple" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fdump-tree-gimple" }
// { dg-final { cleanup-tree-dump "gimple" } }
template < class T > void
// Testcase for DR 975.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
bool b;
struct A { int fn1(); const int& fn2(); };
// Test that this is accepted even when pedantic now that it's part
// of the standard.
-// { dg-options "-std=c++0x -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
bool b;
template <class T>
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
int main() {
int i = 0;
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
int main() {
// PR c++/43875
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
void f();
void f(int);
-// { dg-options "-std=c++0x -pedantic-errors" }
+// { dg-do compile { target c++11 } }
int main()
{
// PR c++/43886
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
void f2() {
int i = 1;
// PR c++/55223
-// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
// { dg-final { scan-assembler "_ZN8functionC1IZN1CIiE4testES_Ed_UliE_EET_" } }
struct function
// Test that capture by copy uses direct-initialization.
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A
{
// Test that we properly clean up if we get an exception in the middle of
// constructing the closure object.
-// { dg-options -std=c++0x }
// This test fails because of PR 41449; it isn't a lambda issue.
// { dg-do run { xfail *-*-* } }
+// { dg-require-effective-target c++11 }
struct A
{
// PR c++/47263
// PR c++/49260
-// { dg-options "-std=c++0x -fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm" }
-// { dg-do run }
+// { dg-options "-fno-asynchronous-unwind-tables -fno-dwarf2-cfi-asm" }
+// { dg-do run { target c++11 } }
#include <exception>
// Test that error messages about creating the closure object refer to
// the lambda-introducer.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/42399
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A {
A();
// declared in the closure type" -- test that there isn't a member of the
// closure with the same name as the captured variable.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template <class T>
struct A: public T
// PR c++/50114
-// { dg-options "-std=c++0x -w" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-w" }
int open()
{
// PR c++/43790
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/42083
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename F>
decltype(F()) run(F f) // { dg-message "note" }
// PR c++/47795
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
class Klass
{
// PR c++/47242
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template < typename > void
bar ()
// PR c++/51227
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<int> int foo()
{
// PR c++/51464
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<int = sizeof([])> struct A {}; // { dg-error "lambda" }
// PR c++/52487
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A; // { dg-error "forward declaration" }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
// PR c++/50863
-// { dg-options -std=gnu++0x }
+// { dg-do compile { target c++11 } }
struct T {
template<typename F>
// PR c++/54947
-// { dg-options -std=gnu++11 }
+// { dg-do compile { target c++11 } }
struct X
{
// Test that we don't crash on a failed lookup.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
int main()
{
// Test lambda mangling
// { dg-require-weak "" }
-// { dg-options "-std=c++0x -fno-inline" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-inline" }
template<typename F> int algo(F fn) { return fn(); }
inline void g(int n) {
// PR c++/49276
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template <int N>
struct F
// PR c++/51818
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZN1AC1IN3foo3barMUlvE_EEET_" } }
struct A
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
int main() {
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
int main() {
// PR c++/56710
-// { dg-options "-std=c++11 -Wall" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
int main()
{
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
// Testcase from N2998
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
void f1(int i) {
int const N = 20;
// PR c++/41896
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
void nested_lambda()
{
// PR c++/47687
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template <class T> struct A { };
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
int main() {
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
auto f = [](int i) { return i+1; };
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
#include <algorithm>
// PR c++/50089
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct TestBase
{
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
//#include <iostream>
#include <functional>
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
// PR c++/49598
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
int
main()
// PR c++/55357
-// { dg-options "-std=c++11 -Wshadow" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wshadow" }
int main() {
int x = 1; // { dg-message "shadowed" }
-// { dg-options "-std=c++11 -Wshadow" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wshadow" }
struct A
{
// Test using std::function wrapper.
-// { dg-do run }
-// { dg-options -std=c++0x }
+// { dg-do run { target c++11 } }
#include <functional>
// PR c++/49867
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
int
main ()
// PR c++/46124
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
void foo() { [] () -> void (); } // { dg-error "returning a function" "returning" }
// { dg-error "expected .\{" "expected" { target *-*-* } 4 }
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
extern "C" void abort();
// PR c++/50276
-// { dg-options "-std=c++11 -Wuninitialized" }
-// { dg-do run }
+// { dg-options "-Wuninitialized" }
+// { dg-do run { target c++11 } }
template<typename T>
unsigned testfun(const T& func)
// PR c++/47049
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
enum { E = 0, F = 1 };
template <int N, int M = ((N == 1) ? F : E)> class S {};
// PR c++/49554
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template<typename T>
struct base
// Test that implicit 'this' capture works, but that it's still an rvalue.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/43856
// Test for implicit 'this' capture via rewriting.
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct S1 {
int operator()(int);
// PR c++/45520
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct M {
int i;
// PR c++/48523
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template<typename>
struct X
// PR c++/53137
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename STORE>
void getParent(STORE& tStore)
// PR c++/54122
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum E { F };
// So, other appearances of 'x' within decltype do not refer to the closure
// member, because they are not "use"s in the sense of 3.2.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template<class T, class U>
struct same_type;
// 5.1.2/2: A lambda-expression shall not appear in an unevaluated operand.
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template <class T>
struct A { };
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
int main(int argc, char** argv)
{
int i;
int &ir = i;
- const int ci = 0;
+ const int ci = 1;
const int &cir = ci;
[] { sizeof (argc); sizeof (i); sizeof (ir); sizeof (ci); sizeof (cir); };
// PR c++/50224
-// { dg-options "-std=c++0x -Wunused-parameter" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-parameter" }
struct T;
// PR c++/49672
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
template<typename ... Args>
static void foo()
// PR c++/41920
-// { dg-options "-std=c++0x -Wall -Wextra" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall -Wextra" }
int foo(int i)
{
// PR c++/42370
-// { dg-options "-std=c++0x -Wall" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
void foo()
{
// PR c++/49482
-// { dg-options "-std=c++0x -Wunused-but-set-parameter" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-but-set-parameter" }
template<class T>
void f() {
// PR c++/52845
-// { dg-options "-std=c++11 -Wall" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
void f()
{
// o the variable or function is not used (3.2 [basic.def.odr]) or is
// defined in the same translation unit.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T> struct B {
void g(T){}
template <typename T> T B<T>::t2 = { };
-enum {} e1; // OK, defined
-extern enum {} e2; // { dg-error "never defined" }
-extern "C" enum {} e3; // OK, extern "C"
+enum { E1 } e1; // OK, defined
+extern enum { E2 } e2; // { dg-error "never defined" }
+extern "C" enum { E3 } e3; // OK, extern "C"
void f() {
struct A { int x; }; // no linkage
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
void foo()
{
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
#include <utility>
-// { dg-options "--std=c++11" }
-// { dg-do link }
+// { dg-do link { target c++11 } }
template<typename _Tp>
inline _Tp&&
// Test: Named rvalue references are treated as lvalues.
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test for noexcept-expression
-// { dg-options "-std=c++11 -O2" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2" }
#include <typeinfo>
// Test for noexcept-specification
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert(X, #X)
// Runtime test for noexcept-specification.
-// { dg-options "-std=c++11 -Wnoexcept" }
+// { dg-options "-Wnoexcept" }
// { dg-do run { target nonpic } }
+// { dg-require-effective-target c++11 }
#include <exception>
#include <cstdlib>
// the compiler doesn't get clever about optimizing the calls based on
// knowledge about the called functions.
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <exception>
#include <cstdlib>
// { dg-final { scan-assembler-not "EHB" } }
// { dg-final { scan-assembler "LSDA" } }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A { ~A(); };
void g();
// Test that checking of a nothrow specification uses the one on the
// definition.
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <exception>
#include <cstdlib>
// Test that checking of a nothrow specification uses the one on the
// definition.
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#include <exception>
#include <cstdlib>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "overriding" }
struct A
// Test that -Wnoexcept works with templates
-// { dg-options "-std=c++11 -Wnoexcept" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wnoexcept" }
template <class T>
T f (T t) { return t; } // { dg-warning "does not throw" }
// PR c++/49082
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std { template <class T> T&& declval() noexcept; }
// PR c++/49107
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename _Tp>
_Tp declval() noexcept;
// Test that we handle merging with deferred noexcept.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class U>
struct O
// PR c++/49107
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std
{
// PR c++/50309
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
void foo () noexcept () { } // { dg-error "expected" }
// PR c++/50391
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <type_traits>
// PR c++/50043
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct True1 {};
struct True2 { ~True2(); };
// PR c++/54207
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef bool B;
constexpr B foo () { return true; }
// PR c++/55652
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename T>
struct A
// PR c++/56071
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class B
{
// Test that this doesn't lead to link-time collisions.
// { dg-additional-sources "nolinkage1a.cc" }
-// { dg-do link }
-// { dg-options -std=c++11 }
+// { dg-do link { target c++11 } }
#include "nolinkage1.h"
// That is, their presence should cause compiler declared
// copy ctor or assignment to be deleted.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <assert.h>
// PR c++/50707
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
int g;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#define SA(X) static_assert(X,#X)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Do NSDMI get deferred instantiation?
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct A
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
// PR c++/51666 (DR 325)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct tuple
// Core issue 1351
// { dg-do run { xfail *-*-* } }
-// { dg-options -std=c++11 }
+// { dg-require-effective-target c++11 }
bool fail;
struct A
// PR c++/50563
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S1 {
int a{10}, b{20}; // OK
// PR c++/50930
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct nmc {
nmc() = default;
-// { dg-do run }
-// { dg-options -std=c++11 }
+// { dg-do run { target c++11 } }
struct base
{
// PR c++/50614
-// { dg-options "-std=c++11 -fcompare-debug" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fcompare-debug" }
struct A
{
// PR c++/51611
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct A
{
-// { dg-do run }
-// { dg-options -std=c++11 }
+// { dg-do run { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
-// { dg-do run }
-// { dg-options -std=c++11 }
+// { dg-do run { target c++11 } }
int c;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct X
{
// Origin PR c++/51477
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/53594
-// { dg-do compile }
-// { dg-options "-std=c++11 -Wuninitialized" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wuninitialized" }
struct A
{
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test assignment to pointer
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test assignment to nullptr_t
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test assignment to int
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test cast to int
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test assignment to method pointer
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test compare to pointer
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test compare to int
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test conversion to bool
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test compare to literal 0
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test arithmetic operations
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test relational operators
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test sizeof
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test typeid
#include <typeinfo>
-#define assert_true(b) do { char c[2 * bool(b) - 1]; } while(0)
-
-void fun()
+int main()
{
- typeid(nullptr);
const decltype(nullptr) mynull = 0;
- typeid(mynull);
- assert_true(typeid(nullptr) == typeid(mynull));
+ if (typeid(nullptr) != typeid(mynull))
+ __builtin_abort();
}
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test overload preference char*/int
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+
// Test template deduction
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test template deduction
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test that bool is a better overload match than int
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test overload of pointer versus bool when applied on a nullptr_t
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+
// Test overload of pointer versus nullptr_t when applied on a literal 0/__null
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test passing to ellipisis
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test throw and catch
-// { dg-do compile }
-// { dg-options "-std=c++11 -Wall -Wformat=2 -Wstrict-null-sentinel" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall -Wformat=2 -Wstrict-null-sentinel" }
// Test various warnings
// PR c++/50361
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
{
Foo(std::initializer_list<Foo>) { };
- template<class T> Foo(T t) { T u(t); };
+ template<class T> Foo(T t) { T u(t); }
private:
union Data
// PR c++/50371
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<decltype(nullptr)>
struct nt;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<decltype(nullptr)>
struct nt{};
// PR c++/51530
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T, class U>
void f(T, U);
// PR c++/52706
-// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } }
template<class T, decltype(nullptr) = nullptr>
// PR c++/53882
-// { dg-options "-std=gnu++11 -O" }
+// { dg-options "-O" }
+// { dg-do compile { target c++11 } }
void f(decltype(nullptr) &__restrict np) { }
-// { dg-options "--std=c++11" }
-// { dg-do link }
+// { dg-do link { target c++11 } }
struct S {};
-// { dg-options "--std=c++11" }
-// { dg-do link }
+// { dg-do link { target c++11 } }
struct T {};
struct S
-// { dg-options "--std=c++11" }
-// { dg-do link }
+// { dg-do link { target c++11 } }
// Generated by overload.py
template<typename _Tp>
// Core 1321
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// Two dependent names are equivalent even if the overload sets found by
// phase 1 lookup are different. Merging them keeps the earlier set.
// PR c++/59823
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct X { };
-// { dg-options "--std=c++11" }
-// { dg-do link }
+// { dg-do link { target c++11 } }
+// { dg-options "" }
// Generated by overload.py
template<typename _Tp>
-// { dg-do compile }
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
struct B
{
virtual void f() final {}
-// { dg-do compile }
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
struct B1 {};
struct B2 final {};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "expected ';'" }
// { dg-prune-output "expected unqualified-id" }
// { dg-prune-output "declaration does not declare anything" }
// PR c++/43509
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef int B; // { dg-message "" }
B::B() {} // { dg-error "" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename, typename..., typename> void foo(); // { dg-message "note" }
void bar()
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename..., typename> void foo(); // { dg-message "note" }
void bar()
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename..., typename> struct A // { dg-error "parameter pack" }
{
static int i;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> int foo(const T&) // { dg-error "not expanded with|T" }
{
union { T t; }; // { dg-error "not expanded with|T" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template <typename... T> struct A // { dg-message "candidates|A" }
{
A(T* p) { // { dg-error "parameter packs|T" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename> struct A;
template<typename T, typename... U> struct A<T(U)> // { dg-error "parameter packs|U" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<char> struct A<> {}; // { dg-error "not used in partial specialization|anonymous|declaration" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T, T = 0> struct A {}; // { dg-error "parameter packs|T|the end|parameter packs|anonymous" }
struct B
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int, typename... T> struct A
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
template<int> void foo(A<T>); // { dg-error "not expanded|T" }
void bar()
{
A<int>().foo<0>(A<int>()); // { dg-error "no member named" }
-};
+}
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template <typename... T> struct A
{
void foo(T...);
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename ...T> struct A
{
typedef typename T::X Y; // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename ...T, int = 0> struct A {}; // { dg-error "end of" }
A<int> a; // { dg-error "mismatch|expected|invalid" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T> struct A<T> // { dg-error "not expanded|T|" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...T> struct A
{
static T i; // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T, typename...U>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int x[5];
template<int M, int N, int (&... p)[N]> struct A;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<void (*... fp)()> struct A
{
A() { fp(); } // { dg-error "not expanded|fp" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int...> struct A;
template<template<int> class... T> struct A<T...> {}; // { dg-error "mismatch|expected" }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<int> struct A;
void foo()
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
typedef const int* type;
float& foo( const type& ggg );
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T>
struct uncvref
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#define BUG
struct type
// PR c++/34054
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> T foo() {} // { dg-error "not expanded|T" }
// PR c++/34056
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
// PR c++/34057
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename... T> struct A
{
// PR c++/34058
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename...T> struct A
{
// PR c++/34060
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <int> struct A
{
// PR c++/34061
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<int> class ...T> struct A : T<0> {}; // { dg-error "not expanded|T" }
/* PR c++/38646 */
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
template<int...> struct A;
// PR c++/38795
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> int foo(int i)
{
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/39639
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "template argument 1 is invalid" }
template <class... Types>
// PR c++/42844
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A // { dg-message "user-provided default constructor" }
{
// PR c++/45908
// Testcase by Jonathan Wakely <redi@gcc.gnu.org>
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct vector {
struct iterator { };
// PR c++/47416
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
namespace std
{
{
}
};
-};
+}
void
foo (const int &a)
// PR c++/47476
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int
foo (int a, int b)
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename T>
struct Handle
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
#include <utility>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct GrandParent {
void *get();
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T> int foo(int a)
{
// PR c++/51150
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct Clock {
double Now();
// PR c++/51216
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
void foo()
{
// PR c++/51225
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A {};
// PR c++/51313
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class ostream;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void
foo()
// PR c++/51463
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/51547
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class T>
struct vector
// PR c++/51619
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A { virtual ~A(); };
struct B { A a[1][1]; } b;
-// { dg-options "-std=c++11 -fcompare-debug" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fcompare-debug" }
typedef long unsigned size_t;
namespace
-// { dg-options "-std=c++11 -Wall -Wextra" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall -Wextra" }
template<class T>
void f(T t, void* = 0) // { dg-warning "unused parameter" }
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/58072
// PR c++/59111
// { dg-do compile { target c++11 } }
-auto& foo(); // { dg-error "type specifier without trailing return type" }
-int i = foo(); // { dg-error "cannot convert" }
+auto& foo(); // { dg-error "type specifier without trailing return type" "" { target { ! c++1y } } }
+int i = foo(); // { dg-error "" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
typedef int T __attribute__((vector_size(2*sizeof(int))));
void foo(T& r, const T& a, const T& b)
// Origin PR c++/51476
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int> struct A {};
struct B
// Test for range-based for loop
// Test the loop with an array
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
extern "C" void abort();
// PR c++/47388
-// { dg-do compile }
-// { dg-options "-fno-for-scope -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-for-scope" }
template <int>
void
// Test the loop with a custom iterator
// with begin/end as member functions
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct iterator
{
// Test for range-based for loop with templates
// and begin/end as member functions
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
/* Preliminary declarations */
namespace pre
// Test for errors in range-based for loops
// with member begin/end
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
//These should not be used
template<typename T> int *begin(T &t)
// Test for other range-based for loops with
// begin/end member functions
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
//These should not be used
template<typename T> int *begin(T &t)
// Test for range-based for loop with templates
// and begin/end as member (non-)virtual functions
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
unsigned int g;
// Test for range-based for loop with arrays of
// incomplete type or unknown size
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
extern int a[10];
extern int b[];
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern "C" int printf (const char *, ...);
enum E { e1, e2, e3, X };
E operator*(E e) { return e; }
E begin(E e) { return e; }
-E end(E e) { return X; };
+E end(E e) { return X; }
E operator++(E& e) { return e = E(e+1); }
int main()
// PR c++/48994
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename T>
struct myvec
// PR c++/49838
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int main()
{
// Test the loop with a custom iterator
// with begin/end in an associated namespace
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct iterator
{
// PR c++/49834
// PR c++/50020
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/49983
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
void f(T t)
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<int I> void f() {
for (auto i: {I} );
// Test the loop with a custom iterator
// with begin/end in std
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct iterator
{
// Test for range-based for loop with templates
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
/* Preliminary declarations */
namespace pre
// Test for errors in range-based for loops
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct container
{
// Test for range-based for loop
// Test the loop with an initializer_list
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <initializer_list>
// PR c++/46056
// Check that range-based for loop calls destructors
// when required
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
extern "C" void abort();
int value_counter = 0, it_counter = 0, seq_counter = 0;
// Test for range-based for loop when the declarator declares
// a new type
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
// Test the reference collapsing rules. Note that there are recent differences
// for how cv-qualifications are applied to reference types. 7.1.3, 14.3.1
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
+++ /dev/null
-This directory contains tests that were passing in C++98 mode but failing
-in C++0x mode; it should be replaced by an improvement to the test harness
-to run all tests in both modes.
+++ /dev/null
-// Copy of abi/empty7.C.
-// { dg-do run { target i?86-*-* x86_64-*-* } }
-// { dg-require-effective-target ilp32 }
-// { dg-options "-fabi-version=0 -std=c++0x" }
-
-struct S1 {};
-struct S2 { virtual void f () {} S1 s1[4]; };
-struct S3 : virtual public S2 {};
-struct S4 : virtual public S2 { int i; };
-struct S5 : public S3, virtual public S4 {};
-struct S6 { S5 s5; };
-struct S7 { S1 s1[5]; };
-struct S8 : public S1, public S6, virtual public S7 { };
-
-S8 s8;
-
-int main () {
- if ((char *)(S7 *)&s8 - (char *)&s8 != 24)
- return 1;
-}
+++ /dev/null
-// { dg-do compile }
-// { dg-options -std=c++0x }
-
-void f (int);
-
-int
-main() {
-
- int a = 4;
- int b = 5;
- int (*x)[b] = new int[a][b]; // { dg-error "array size.*must be constant|usable in a constant" }
-
- x[2][1] = 7;
-
- for (int i = 0; i < a; ++i)
- for (int j = 0; j < b; ++j)
- f (x[i][j]);
- delete [] x;
-}
+++ /dev/null
-// PR c++/48212
-// { dg-options -std=c++0x }
-
-template < bool > void
-foo ()
-{
- const bool b =; // { dg-error "" }
- foo < b > (); // { dg-error "constant expression" "const expr" }
-};
-
-// { dg-error "no match" "no match" { target *-*-* } 8 }
+++ /dev/null
-// PR c++/12515
-// { dg-do compile }
-// { dg-options "-std=gnu++0x" }
-template<int> void foo() { 0 ?: 0; }
+++ /dev/null
-// PR c++/33836
-// { dg-do compile }
-// { dg-options "-std=gnu++0x" }
-
-template<int N> struct A
-{
- enum { M = && N }; // { dg-error "referenced outside|cannot appear in|not an integer constant" }
-};
-
-A<0> a;
-
-void foo ()
-{
- __label__ P;
- enum { O = && P }; // { dg-error "cannot appear in|not an integer constant" }
- P:;
-}
+++ /dev/null
-// PR c++/41786
-// { dg-options -std=c++0x }
-
-struct A { A(int, char const*); };
-int main() {
- int i = 0, *b = &i;
- A a(int(b[i]), "hello");
-}
+++ /dev/null
-// PR c++/38647
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
-// { dg-prune-output "note" }
-
-template<const char *, int> struct A {};
-const char func[] = "abc";
-template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|constant expression" }
-
-char a1[1];
-A<a1, 0> a;
-
-template<const char *, int> struct B {};
-template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|constant expression" }
-
-char b1[1];
-B<b1, 0> b;
-
-template<const char *, int> struct C {};
-template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|constant expression" }
-
-char c1[1];
-C<c1, 0> c;
-
-template<const char *, int> struct D {};
-template<int N> struct D<__func__, N> {}; // { dg-error "(cannot appear|is invalid|is not a valid|function scope|constant expression)" }
- // { dg-warning "function scope" "function scope" { target *-*-* } 26 }
-
-char d1[1];
-D<d1, 0> d;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/51868
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
A() {}
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void f(int i)
{
// Test for const_cast to reference (5.2.11/4).
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> T&& xval();
template <class T> T& lval();
// PR c++/49267
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct X {
operator int&();
// PR c++/36816, core issue 873
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> void h (T&&) { }
// PR c++/48313
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename F>
void f(F&&) { }
// PR c++/49389
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T> T&& val();
// PR c++/48457, Core 1238
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/49458
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef void ftype();
// DR 1328
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> struct A {
operator T&(); // #1
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> T&& declval();
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
void f(int &);
void f(int &&ir) { ir = 42; }
// PR c++/45401
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
typedef int &__restrict restrictLvref;
typedef restrictLvref &&rvrefToRestrictLvref;
// PR c++/41815
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T, typename U> struct same_type;
template<typename T> struct same_type<T, T> {};
// PR c++/44870
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
void foo(int&& data);
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/33235
#include <cassert>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
struct A
{
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template <bool> struct sa;
template <> struct sa<true> {};
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// Test overload resolution among reference types
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-skip-if "packed attribute missing for struct one/three/five/seven" { "epiphany-*-*" } { "*" } { "" } }
template <bool> struct sa;
// PR c++/36744
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
struct S
{
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Contributed by Sylvain Pion
static int rvalue_constructions = 0;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
enum class Color1 {
Red,
Green,
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
enum class E { e = 10 };
enum E2 { e2 = 10 };
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
enum class Col { red, yellow, green };
int x = Col::red; // { dg-error "cannot convert" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template< typename T_VECTOR >
void f(const T_VECTOR &a, decltype(a[0]) t = 0);
// PR c++/48452
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std {
template <class T> T&& declval();
}
// PR c++/48468
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
template<class T>
// PR c++/48535
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T{})
// PR c++/48581
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/48557
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref
// PR c++/48531
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T())
// PR c++/48531
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T())
B2(...);
};
-#define SA(X) static_assert ((X), #X);
+#define SA(X) static_assert ((X), #X)
SA(sizeof(f<B2[2]>(0)) != 1);
// PR c++/48530
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T{})
// PR c++/48530
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T())
// PR c++/48737
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/44967
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T> T&& declval();
// PR c++/48744
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref {
// PR c++/48735
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T,
class = decltype(T{})
// PR c++/48745
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref {
// PR c++/48647
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template< class T >
T&& declval();
// PR c++/49058
// This error is not subject to SFINAE because it doesn't happen in the
// deduction context.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
template<typename T> T val();
// PR c++/49105
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T, class = decltype(T{})>
char f(int);
// PR c++/49229
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern void* enabler;
// PR c++/50157
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T val();
// PR c++/50324
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct complete { };
struct incomplete;
// PR c++/51047
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T> T &&declval();
template<class T> decltype(declval<T>().x) f(T *);
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std { template <class T> T&& declval(); }
// PR c++/51973
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
-void f(T t) { };
+void f(T t) { }
template <class T> decltype(f<T>(0)) g();
template <class T> decltype(f<T*>(0)) g();
// PR c++/51989
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename T>
struct is_container
// PR c++/52422
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref
// PR c++/52422
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
struct add_rval_ref
// PR c++/52363
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <type_traits>
// PR c++/52363
-// { dg-options "-std=c++11 -pedantic" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-pedantic" }
#include <type_traits>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std { template <class T> T&& declval(); }
// PR c++/56208
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct ostream {
ostream& operator<<(int);
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/48113
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T> T declval();
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/48449
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T, class = decltype(T())>
char f(int);
// PR c++/48450
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std {
template <class T> T&& declval();
-};
+}
template<class To, class From,
class = decltype(static_cast<To>(std::declval<From>()))
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
void foo()
{
static_assert(1, "okay");
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int I>
struct accept_evens {
static_assert( I % 2 == 0, "I must be an even number"); // { dg-error "even number" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
static_assert(7 / 0, "X"); // { dg-error "non-constant condition" "non-constant" }
// { dg-warning "division by zero" "zero" { target *-*-* } 2 }
// { dg-error "7 / 0.. is not a constant expression" "not a constant" { target *-*-* } 2 }
-// { dg-options "-std=c++11 --param ggc-min-heapsize=0 --param ggc-min-expand=0 " }
+// { dg-do compile { target c++11 } }
+// { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0 " }
// PR C++/30033
// Make sure that the static assert does not crash the GC.
// PR c++/50837
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
struct z
// PR c++/51397
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
static_assert('X' != '\130', "'X' has the wrong value"); // { dg-error "'X' has the wrong value" }
// PR c++/53166
-// { dg-options "-std=c++11 -Waddress" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Waddress" }
template <typename X, X a>
struct A
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// [basic.types]/10:
// Scalar types, standard-layout class types (Clause 9), arrays of such
#define TRY(expr) static_assert (expr, #expr)
#define YES(type) TRY(std::is_standard_layout<type>::value); \
TRY(std::is_standard_layout<type[]>::value); \
- TRY(std::is_standard_layout<const volatile type>::value);
+ TRY(std::is_standard_layout<const volatile type>::value)
#define NO(type) TRY(!std::is_standard_layout<type>::value); \
TRY(!std::is_standard_layout<type[]>::value); \
- TRY(!std::is_standard_layout<const volatile type>::value);
+ TRY(!std::is_standard_layout<const volatile type>::value)
#define NONPOD(type) TRY(!std::is_pod<type>::value); \
TRY(!std::is_pod<type[]>::value); \
- TRY(!std::is_pod<const volatile type>::value);
+ TRY(!std::is_pod<const volatile type>::value)
struct A;
-// { dg-do compile }
-// { dg-options "-std=c++11 -fext-numeric-literals" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fext-numeric-literals" }
// Integer imaginary...
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+
// Integer imaginary...
// PR c++/47198
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct S
{
-// { dg-options "--std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
struct S { };
-// { dg-options "--std=c++11" }
-// { dg-options "-Wno-abi --std=c++11" { target arm_eabi } }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-abi" { target arm_eabi } }
#include <stdarg.h>
struct S { };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U>
struct is_same
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class T, class U = double>
void f(T t = 0, U u = 0); // { dg-message "note" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U = typename T::value_type>
void f(T);
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
class X {
template<typename T = int> friend void f(X) { }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class Z = void, class T>
void Foo(T)
// Test the "Augmented" template argument deduction when binding an lvalue to an rvalue reference.
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
// Tests for late-specified return type.
-// { dg-options "-std=c++11 -fabi-version=5" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=5" }
auto f() -> int
{
// { dg-do compile { target c++11 } }
auto f1 () -> int;
-auto f2 (); // { dg-error "without trailing return type" }
+auto f2 (); // { dg-error "without trailing return type" "" { target { ! c++1y } } }
int f3 () -> int; // { dg-error "trailing return type" }
auto *f4 () -> int; // { dg-error "trailing return type" }
struct A
{
auto f5 () const -> int;
- auto f6 (); // { dg-error "without trailing return type" }
+ auto f6 (); // { dg-error "without trailing return type" "" { target { ! c++1y } } }
int f7 () -> int; // { dg-error "trailing return type" }
auto *f8 () -> int; // { dg-error "trailing return type" }
};
// More auto/decltype mangling tests.
-// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
template <class T>
struct B
// PR c++/38597
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T, class U>
auto f(T,U) -> decltype(T() + U())
// PR c++/38798, DR 770
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {};
auto foo() -> struct A {}
// PR c++/49003
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A {
auto a() const -> decltype(this) { return this; }
// PR c++/50365
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { int i; };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// [basic.types]/10:
// Scalar types, trivial class types (Clause 9), arrays of such types and
#define TRY(expr) static_assert (expr, #expr)
#define YES(type) TRY(std::is_trivial<type>::value); \
TRY(std::is_trivial<type[]>::value); \
- TRY(std::is_trivial<const volatile type>::value);
+ TRY(std::is_trivial<const volatile type>::value)
#define NO(type) TRY(!std::is_trivial<type>::value); \
TRY(!std::is_trivial<type[]>::value); \
- TRY(!std::is_trivial<const volatile type>::value);
+ TRY(!std::is_trivial<const volatile type>::value)
struct A;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <cstddef>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <cstddef>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <cstddef>
// PR c++/52521
-// { dg-do compile }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <cstddef>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern "C" {
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <string>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
#include <string>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
constexpr unsigned long long
operator"" _grow(unsigned long long n)
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Check that undeclared literal operator calls and literals give appropriate errors.
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Make sure embedded quotes are not a problem for string and char literals.
#include <cassert>
int operator"" _embedchar(char)
-{ return 41; };
+{ return 41; }
int operator"" _embedstr(const char*, std::size_t len)
-{ return 42 + len; };
+{ return 42 + len; }
void
test()
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
long double
operator"" _Hertz(long double);
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test user-defined literals.
// Test simple operator declaration and definition.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <cstdint>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Literal operators can be inline.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
extern "C"_badlinkage { // { dg-error "expected unqualified-id before" }
// PR c++/52521
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_Zli2_wPKc" } }
int operator "" _w(const char*);
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class Foo
{
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test user-defined literals.
// Test simple operator declaration and definition in namespaces.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test user-defined literals.
// Test error on non-function declaration.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test user-defined literals.
// Test error on non-empty string after 'operator' keyword.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
float operator ""_abc(const char*);
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
char32_t
operator"" (char32_t C) // { dg-error "expected suffix identifier" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Test user-defined literals.
// Test warning on declaration without leading underscore.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Can't have *both* literal operator template and raw literal operator.
-// { dg-options "-std=c++11 -Woverflow" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Woverflow" }
// PR c++/52654
-
int
operator"" _w(unsigned long long)
{ return 0; }
-// { dg-options -std=c++11 }\r
+// { dg-do compile { target c++11 } }
// PR c++/52654\r
\r
int\r
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
int
operator"" _badpreproc(const char *str)
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/50958
typedef decltype(sizeof(0)) size_type;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Make sure handing a string to a raw literal generates a sensible error message.
int operator"" _embedraw(const char*)
-{ return 41; };
+{ return 41; }
int k = "Boo!"_embedraw; // { dg-error "unable to find string literal operator" }
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <cassert>
#include <cstring>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <string>
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
#include <cstdint>
#include <cassert>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// Test that the standard suffixes shadow any user-defined suffixes of the same name.
long double
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/50941
typedef decltype(sizeof(0)) size_type;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target stdint_types }
// PR c++/55582
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <string>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include "udlit_system_header"
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Test user-defined literals.
// Test template operator declaration and definition.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<char...>
int operator"" _xyz(unsigned long long); // { dg-error "has invalid argument list" }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<char...>
int operator"" _abc();
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class Foo { };
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
class Foo { };
// Negative test for C++11 unrestricted unions
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "implicitly deleted because" }
struct A
// Positive test for C++11 unrestricted unions
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A
{
// Runtime test for C++11 unrestricted unions
-// { dg-options -std=c++11 }
-// { dg-do run }
+// { dg-do run { target c++11 } }
int c, d;
struct A
// PR c++/48537
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct SFoo
{
// PR c++/49803
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
struct X
{
// Test: Unamed rvalue references are treated as lvalues.
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <bool> struct sa;
template <> struct sa<true> {};
// PR c++/45236
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T, class S> class foo;
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
// A basic implementation of TR1's bind using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
#define ONE
#define TWO
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/39637
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class... Types>
void
{
f(0);
}
-
-// { dg-message "note" "Types" { target *-*-* } 10 }
// PR c++/49205
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
#include <initializer_list>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename ... Elements> class Tuple;
Tuple<>* t; // OK: Elements is empty
Tuple* u; // { dg-error "template-name" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Types> struct Tuple { };
Tuple<> t0; // Types contains no arguments
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Types>
void f(Types... args);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Types>
void f(Types... rest);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename U> struct is_same {
static const bool value = false;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class T> class A { /* ... */ };
template<class T, class U = T> class B { /* ... */ };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class... Types> struct B { // { dg-error "declaration of" }
void f3();
void f4();
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class X, class Y, class... Z> X f(Y); // { dg-message "note" }
void g()
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class X, class Y, class Z> X f(Y,Z); // { dg-message "note" }
template<class... Args> void f2();
void g()
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Types> void f(Types... values);
void g()
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class...> struct Tuple { };
template<class... Types> void f(Types&...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct Tuple { };
template<typename... Types> char& g(Tuple<Types...>); // #1
template<typename T1, typename... Types> short& g(Tuple<T1, Types...>); // #2
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class> struct X { static const bool primary = true; };
template<class R, class... ArgTypes> struct X<R(int, ArgTypes...)> {
static const bool primary = false;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args> char& f(Args... args); // #1
template<typename T1, typename... Args> short& f(T1 a1, Args... args); // #2
template<typename T1, typename T2> int& f(T1 a2, T2 a3); // #3
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T, class U> struct A { };
template<class... T, class ... U> void f( A<T,U>... p);
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
// A basic implementation of TR1's function using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
// PR c++/33510
#define SIZE_FROM_CTOR
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct int_placeholder;
-// { dg-options "-std=gnu++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
// A basic implementation of TR1's mem_fn using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// Contributed by Peter Dimov
// PR c++/32597
#include <assert.h>
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// PR c++/32597
#include <assert.h>
#include <new>
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class... T>
void f(T..., int, T...) { }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/33939
template<typename T>
struct refs_only;
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
// PR c++/33509
template<int M, int N> struct pair
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// PR c++/34101
template<typename> struct A {};
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
// An implementation of TR1's <tuple> using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/40155
-// { dg-options "-std=c++11" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template <typename T> struct identity
{ typedef T type; };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct tuple { };
template<typename... Args1, typename... Args2>
// PR c++/50086
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T> void tfun();
template<typename T> void fun1(T);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...>
class tuple;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct pair {};
// PR c++/43143
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T>
T&& declval();
// PR c++/43382
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
struct Container
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct nAny {
template<class... T>
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/47289
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
template <template <typename... __ARGS> class _F, typename... _ARGS>
// Origin: PR c++/47326
-// { dg-options "-std=c++11" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template <int _N>
struct A
// PR c++/48451
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
namespace std {
template <class T> T&& declval();
// PR c++/48736
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T&& create();
// PR c++/48292
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename... Args> int g(Args...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct count;
template<>
// PR c++/45698
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class... Ts> struct tuple { };
// PR c++/48424
-// { dg-options "-std=c++11 -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
template<typename... Args1>
struct S
// PR c++/49420
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct A { };
// PR c++/49251
-// { dg-options "-std=c++11 -Wunused-parameter" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused-parameter" }
struct A {};
template <int> int f(A);
// PR c++/49785
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename, typename ...> struct B { };
template <typename> class A;
// PR c++/49593
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename... T> void f(T...) { }
// Origin: PR c++/48320
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class... T>
struct tuple
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T> struct A { typedef T type; };
// This should fail deduction, before it produces a candidate.
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class... T>
void f(T... ts); // { dg-message "deduction" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
// A tuple type
template<typename... Args> struct tuple { };
// PR c++/51507
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename ...>
struct foo { typedef void type; };
// PR c++/52043
-// { dg-options "-std=c++11 -Wreturn-type" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wreturn-type" }
template < class T > struct Container
{
// PR c++/52292
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <template <typename...> class T>
struct foo {
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args> struct tuple1 { };
template<typename... Args> struct tuple2 { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template <typename ...> struct S;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename R, typename... ArgTypes>
struct make_function_type
{
// PR c++/56782
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<class T>
T&& declval();
// PR c++/60248
-// { dg-options "-std=c++11 -g -fabi-version=2" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -fabi-version=2" }
template<int...> struct A {};
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename R, typename... ArgTypes>
struct make_function_type
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename R, typename... ArgTypes>
struct make_function_type
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename R, typename... ArgTypes>
struct make_function_type
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...> class tuple { };
template<typename T, template<typename T> class... Metafunctions>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple {
static const int value = 0;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args = int> // { dg-error "default argument" }
class tuple2;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T> struct add_pointer;
template<typename T> struct add_reference;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, int... Dims>
struct array { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename R, typename... ArgTypes>
struct make_function_type
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, int... Dims>
struct array {
static const int value = 0;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, T... Values>
struct vector_c { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int... Values>
struct sum;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<template<int, int> class Meta, int Initial, int... Values>
struct accumulate {
static const int value = Initial;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename Signature>
struct function_traits;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename Signature>
struct function_traits;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename Signature>
struct function_traits;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
class tuple {};
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T>
void eat(T...);
-// { dg-options "-std=gnu++11 -g" }
+// { dg-options "-g" }
+// { dg-do compile { target c++11 } }
template<typename... T>
void eat(T...) { }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... T>
void eat(const T&...) { }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
void print_all() {}
template<typename T, typename... Rest>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int I, typename... Args>
void get_ith(const Args&... args);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int I, typename... Args>
void get_ith(const Args&... args); // { dg-message "note" }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename... Args>
void f(const T&, const Args&... args)
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Values>
struct tuple
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int... Values>
struct int_vec {};
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple {};
-// { dg-options "-std=gnu++11 -fabi-version=0" }
-// { dg-do compile }
+// { dg-options "-fabi-version=0" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
class tuple {};
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Values, typename T>
struct backward_tuple {}; // { dg-error "end" }
// A function parameter pack is only deduced if it's at the end
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
void f(const Args&... args, int oops);
-// { dg-options "-std=gnu++11 -fabi-version=5" }
-// { dg-do compile }
+// { dg-options "-fabi-version=5" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
void f(Args...) { }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
int f(const Args&...);
-// { dg-options "-std=gnu++11" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template<typename... Args>
int f(const Args&...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
int& f(Args...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
int& f(Args&...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T> struct wrap { };
template<typename... Args>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, typename... Args>
int& f(const T&, Args...);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
int& f(...);
template<typename... Args>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple {
static const int value = 0;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
int& f(int, double, ...);
template<typename... Args>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
float& f(T1, T2);
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, T... Values>
struct vector_c { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename F, typename... BoundArgs>
class bound_functor
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename F, typename... BoundArgs>
class bound_functor
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename F, typename... BoundArgs>
class bound_functor
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Elements>
struct tuple { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T, int... Dims>
struct array {
int foo();
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
#include <typeinfo>
template<typename... Args>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<class T, typename... VarArgs>
void print(T t, VarArgs args); // { dg-error "packs not expanded" }
// { dg-message "VarArgs" "note" { target *-*-* } 3 }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename ... Args>
struct tuple_base {};
-template<typename... Args> class tuple; // { dg-error "variadic templates" "" { target c++98 } }
+template<typename... Args> class tuple; // { dg-error "variadic templates" "" { target { ! c++11 } } }
-// { dg-options "-std=gnu++11 -pedantic" }
+// { dg-options "-pedantic" }
+// { dg-do compile { target c++11 } }
template<typename... Args> class tuple;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int... Indexes>
struct _Index_tuple { };
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
struct unused;
template<typename T1 = unused, typename T2 = unused, typename T3 = unused,
typename T4 = unused, typename T5 = unused, typename T6 = unused>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename Result, typename Functor, typename... ArgTypes>
Result bind(Functor, ArgTypes...) { }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Elements> struct tuple {};
template<typename... Args>
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
extern "C" void abort();
template<typename T, T... Values>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T>
struct stored_value
{
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple_base {
static const int value = 0;
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
template <typename T, T... Args> struct bomb;
template <typename T>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct list {};
template<typename Sequence, typename Head>
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
struct A {};
struct B {};
struct C {};
-// { dg-do run }
-// { dg-options "-std=gnu++11" }
+// { dg-do run { target c++11 } }
struct A {};
struct B {};
struct C {};
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct tuple { };
// PR c++/33496
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int... N> int foo ()
{
// PR c++/33496
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int M, int N> struct pair
{
// PR c++/33496
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<int M, int N> struct pair
{
// PR c++/33213
-// { dg-do compile }
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<template<typename> class...> struct A;
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename... Args>
struct tuple_base {
static const int value = 0;
// PR c++/31434
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
extern "C" void abort ();
// PR c++/33461
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename> struct A;
// PR c++/33461
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename> struct A;
// PR c++/31441
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename> struct A;
// PR c++/32565
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A1;
template<template<int...> class T> struct A1<T<0> > {};
// PR c++/32565
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A1;
template<template<int, int...> class T> struct A1<T<0, 1> > {};
// PR c++/33943
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... A> struct foo {};
// PR c++/33965
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename T>
struct foo
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<typename...> class TT>
TT<int, float, double> foo(TT<int, float>)
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// Contributed by Eric Niebler
template<typename T, typename U>
struct pair
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct pair {};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<typename...> class TT>
struct X { };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int N> struct Int2Type { };
template<typename... T>
// Various tests for variadic templates and partial specialization.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/36846
template<typename A, typename B>
// PR c++/35297
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <class T=int, class... ARGS>
struct test2 {};
// PR c++/40595
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int N>
struct S
// PR c++/39863
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <typename... T>
struct A {};
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/41785
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
struct a {};
// PR c++/42266
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template<typename... _Elements>
class tuple;
// PR c++/42358
-// { dg-do assemble }
-// { dg-options -std=c++11 }
+// { dg-do assemble { target c++11 } }
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef __SIZE_TYPE__ size_t;
// PR c++/43054
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename R> struct future { };
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename ... Args>
struct foo
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {};
template<typename... T> struct B : T...
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
int i __attribute__((aligned(__alignof(T)))); // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
operator int();
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T, typename = T> struct A {}; // { dg-error "must be at the end" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/34055
template<typename...> struct A;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/34102
struct A {};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/34103
template<typename> struct A {};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<typename... T> class Comp, typename... T> void f( T... Value)
{
static_assert( Comp<T>::value > 0, "" ); // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename T, T a, T... Params>
struct max
{
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename Fun, typename... Args> // { dg-error "template parameter" }
struct call;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int...> struct A
{
void foo();
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename T, typename... U> struct A<T, U> // { dg-error "parameter packs|U" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// PR c++/34751
struct A {};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
template<T> struct B {}; // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<template<int> class... T> struct A
{
void foo(T<0>); // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename> struct A {};
template<template<typename> class... T> void foo(T<int>) {} // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<int... N> struct A
{
static void foo()
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
static const int i __attribute__((aligned(__alignof(T)))) = 0; // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> int foo()
{
T t; // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> int foo()
{
typename T::X x; // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename... T> struct A
{
T* x[1]; // { dg-error "parameter packs|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename _Tp>
_Tp&& forward(_Tp&& __t) { return __t; } // { dg-message "note" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A
{
template<typename... T> struct B;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct A {};
template<typename... T> struct B : T...
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<typename...> struct A;
template<typename...T> struct A<T*> // { dg-error "not expanded|T" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "note" }
void f() { }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template<class U, class... T>
void f() // { dg-message "note" }
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename... Types> struct package {};
-// { dg-options "-std=c++11 -pedantic-errors" }
+// { dg-do compile { target c++11 } }
// { dg-prune-output "invalid" }
template<int>struct A{};
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
struct foo {
foo(int a, float b);
// PR c++/55542
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
template <typename ... P>
struct B
+// { dg-do compile { target c++11 } }
// { dg-options "-std=gnu++98 -Wc++11-compat" }
int static_assert; // { dg-warning "is a keyword" }
int nullptr; // { dg-warning "is a keyword" }
// PR c++/50810
+// { dg-do compile { target c++11 } }
// { dg-options "-std=gnu++98 -Wc++11-compat" }
signed char data[] = { 0xff }; // { dg-warning "narrowing" }
// PR c++/50810
+// { dg-do compile { target c++11 } }
// { dg-options "-std=gnu++98 -Wc++11-compat -Wno-narrowing" }
signed char data[] = { 0xff };
-// { dg-do compile }
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11_only } }
class [[deprecated]] A // { dg-warning "attribute directive ignored" }
{
-// { dg-do compile }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
class [[deprecated]] A
{
// DR 1586
-// { dg-options "-std=c++1y" }
-// { dg-do run }
+// { dg-do run { target c++1y } }
template <class T>
void f (T* p)
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
constexpr auto f() { return (char)42; }
#define SA(X) static_assert ((X),#X)
// A template declared with auto should be declared with auto in an
// explicit instantiation or explicit specialization, too.
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template <class T>
auto f(T t) { return t; }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
auto f() { return; } // OK, return type is void
auto* g() { return; } // { dg-error "no value" }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
// { dg-final { scan-assembler "_ZN1AIiEcvDaEv" } }
template <class T>
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
struct A {
template <class T>
// PR c++/56177
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
auto f ();
auto f () { return 33; }
-// { dg-options "-std=c++1y -Wno-return-local-addr" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-Wno-return-local-addr" }
template<class,class> struct same_type;
template<class T> struct same_type<T,T> {};
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template<class,class> struct ST;
template<class T> struct ST<T,T> {};
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
int c;
int d;
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
struct A
{
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
template <class T>
auto f() { return T::i; }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
auto f() { return f(); } // { dg-error "auto" }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
template <class T>
auto f(T) { return 42; }
// N3638: decltype(auto) must stand alone
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
void f();
decltype(auto) g1() { return &f; }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
struct A
{
// PR c++/58561
-// { dg-options "-std=c++1y -g" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-g" }
auto foo();
// PR c++/60314
-// { dg-options "-std=c++1y -g" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-g" }
// fine
decltype(auto) qux() { return 42; }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
bool b;
auto f()
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template <class T>
constexpr auto f(T t) { return t+1; }
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
int i;
auto& f() { return i; }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template <class T, class U> struct ST;
template <class T> struct ST<T,T> {};
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
auto f();
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
auto f() { return 42; } // { dg-message "old declaration .auto" }
auto f(); // OK
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
// { dg-final { scan-assembler "_Z1fIiERDaRKT_S1_" } }
template <class T>
// Mangling for decltype(auto)
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
void f();
// PR c++/60312
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template<typename> struct A;
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
#if __cplusplus <= 201103L
#error
-// { dg-options -std=c++11 }
+// { dg-do compile { target { ! c++1y } } }
#define assert(E) if(!(E))__builtin_abort();
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
int
main()
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
#define assert(E) if(!(E))__builtin_abort();
// Out-of-line generic member function definitions.
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A {
void f(auto x);
// Testcase for an extension to allow return type deduction when the lambda
// contains more than just a single return-statement.
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
bool b;
template <class T>
// Generic lambda conversion to function ptr test from N3690 5.1.2.6
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void f1(int (*)(int)) { }
void f2(char (*)(int)) { }
// Generic lambda type dependence test part from N3690 5.1.2.12
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
void f(int, const int (&)[2] = {}) { } // #1
void f(const int&, const int (&)[1]) { } // #2
// Mixed explicit and implicit generic lambda test.
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
int main()
{
// Ensure that generic lambdas properly construct and destroy user types.
-// { dg-options "-std=c++1y -DUSE_AUTO_SYNTAX" }
-// { dg-do run }
+// { dg-options "-DUSE_AUTO_SYNTAX" }
+// { dg-do run { target c++1y } }
int i = 3;
// Basic generic lambda test
-// { dg-options "-std=c++1y" }
-// { dg-do run }
+// { dg-do run { target c++1y } }
template <typename T, typename U> struct pair {};
template <typename... T> struct tuple {};
// PR c++/59271
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
extern "C" int printf (const char *, ...);
// Explicit generic lambda test from N3690 5.1.2.5
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
#include <iostream>
// Explicit generic lambda conversion to function ptr test from N3690 5.1.2.6
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void f1(int (*)(int)) { }
void f2(char (*)(int)) { }
// Ensure that generic lambdas properly construct and destroy user types.
-// { dg-options "-std=gnu++1y -DUSE_EXPLICIT_TEMPLATE_SYNTAX" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-DUSE_EXPLICIT_TEMPLATE_SYNTAX" }
#include "lambda-generic-udt.C"
// Generic lambda test from N3690 5.1.2.5
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
#include <iostream>
// Test for the explicit initializer extension of C++1y
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
int main()
{
// N3648: capture init
-// { dg-options "-std=c++1y -w" }
-// { dg-do run }
+// { dg-options "-w" }
+// { dg-do run { target c++1y } }
int main()
{
// N3648: redundancy and capture init
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
int main()
{
// N3648: capture init at non-block scope
-// { dg-options "-std=c++1y -w" }
-// { dg-do run }
+// { dg-options "-w" }
+// { dg-do run { target c++1y } }
int i = 42;
int j = [x=i]{ return x; }();
// N3648: capture init example from paper
-// { dg-options "-std=c++1y" }
-// { dg-do run }
+// { dg-do run { target c++1y } }
int x = 4;
auto y = [&r = x, x = x+1]()->int {
// Test for paren and brace initializers
-// { dg-options "-std=c++1y" }
-// { dg-do run }
+// { dg-do run { target c++1y } }
#include <initializer_list>
// Test that simple captures are not named in the closure type, but
// initialized captures are named.
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
int main()
{
// PR c++/59349
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
int foo () {
[bar()]{}; // { dg-error "empty initializer" }
// Test that the parens don't show up in the mangling
-// { dg-options "-std=c++1y -Wno-return-local-addr" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-Wno-return-local-addr" }
// { dg-final { scan-assembler "_Z1gI1AEDTdtfp_1iET_" } }
struct A { int i; };
-// { dg-options -std=c++1y }
-// { dg-do compile }
+// { dg-do compile { target c++1y } }
#include <chrono>
// PR c++/58500
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A {};
// PR c++/58533
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
void foo()
{
// PR c++/58534
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
template<typename> void foo(const auto&) {}
// PR c++/58535
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A
{
// PR c++/58536
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A
{
// PR c++/58548
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void foo(auto)
{
// PR c++/58549
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void foo(auto)
{
// PR c++/58637
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
template<> void foo(auto); // { dg-error "auto|not a template" }
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
template<typename, typename>
struct is_same
// PR c++/59110
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
int i = *(auto*)0; // { dg-error "" }
// PR c++/59112
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
void foo()
{
// PR c++/59113
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
void foo()
{
// PR c++/59629
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
void foo(int i = []{ auto 0; }()); // { dg-error "expected|could not convert" }
// PR c++/59635
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
auto f = [] (auto, ...) { return 0; };
// PR c++/59636
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
auto f = []() { return []<>() {}; }; // { dg-error "expected identifier" }
// PR c++/59638
-// { dg-do compile }
-// { dg-options "-std=gnu++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void (*a)(auto); // { dg-error "template declaration" }
// PR c++/60052
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A
{
// PR c++/60053
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
struct A
{
// PR c++/60064
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
class A
{
// PR c++/60065
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
template <int> void foo(auto... x);
template <typename> void foo2(auto... x);
// PR c++/60190
-// { dg-do compile }
-// { dg-options "-std=c++1y" }
+// { dg-do compile { target c++1y } }
auto f = []<int>() -> int() {}; // { dg-error "returning a function|expected" }
// PR c++/60311
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template<void(*)(auto)> struct A {}; // { dg-error "auto" }
// PR c++/60376
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
struct A
{
// PR c++/60377
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
void foo(auto, void (f*)()); // { dg-error "expected" }
// PR c++/60409
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
struct A
{
// Origin: Dodji Seketeli <dodji@redhat.com>
-// { dg-options "-std=c++1y -pedantic-errors" }
-// { dg-do compile }
+// { dg-do compile { target c++1y } }
#include "../system-binary-constants-1.h"
-// { dg-options -std=c++11 }
+// { dg-do compile { target { c++11 && { ! c++1y } } } }
template<typename CharT, CharT... String>
int
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template<typename CharT, CharT... String>
int
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
int
operator "*"_s(unsigned long long) // { dg-error "expected empty string after 'operator'" }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
int
operator L""_Ls(unsigned long long) // { dg-error "invalid encoding prefix in literal operator" }
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
#include "complex_literals.h"
-// { dg-do run }
-// { dg-options "-std=c++1y" }
+// { dg-do run { target c++1y } }
#include <initializer_list>
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
#include <typeinfo>
// PR c++/57402
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
int i = 2;
// PR c++/60251
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
void foo(int n)
{
// PR c++/60250
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
template<typename> void foo()
{
// PR c++/60227
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
void foo(int n)
{
// N3639 allows initialization and capture of VLAs
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
void f(int n)
{
// Test for throwing bad_array_length on invalid array length
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
#include <new>
// Test for range-based for with VLAs.
-// { dg-options -std=c++1y }
-// { dg-do run }
+// { dg-do run { target c++1y } }
#include <new>
// PR c++/55149
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
void test(int n) {
int r[n];
// PR c++/57404
-// { dg-options "-std=c++11 -g" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g" }
void f (int i)
{
// PR c++/55149
-// { dg-options -std=c++1y }
+// { dg-do compile { target c++1y } }
template<unsigned int TA>
struct SA
// PR c++/57408
-// { dg-options "-std=c++1y -pedantic-errors" }
+// { dg-do compile { target c++1y } }
template<typename Callable>
struct Impl
// PR debug/41828
-// { dg-do compile }
-// { dg-options "-gdwarf-2 -dA -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-gdwarf-2 -dA" }
// { dg-final { scan-assembler-not "<anonymous" } }
// { dg-final { scan-assembler-not "\\._\[0-9\]" } }
// { dg-final { scan-assembler-not "\$_\[0-9\]" } }
// PR c++/53756
-// { dg-options "-std=c++1y -g -dA -fno-debug-types-section" }
+// { dg-do compile { target c++1y } }
+// { dg-options "-g -dA -fno-debug-types-section" }
// We're looking for something like
// .uleb128 0x3 # (DIE (0x33) DW_TAG_subprogram)
-// { dg-do compile }
-// { dg-options "-g -dA -gno-strict-dwarf -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA -gno-strict-dwarf" }
// { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_enumeration_type" 3 } }
// { dg-final { scan-assembler-times " DW_AT_enum_class" 2 } }
// PR c++/43912
-// { dg-options "-g -std=c++0x -dA -fno-merge-debug-strings -gno-strict-dwarf" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA -fno-merge-debug-strings -gno-strict-dwarf" }
// Check for the local alias variables that point to the members of the closure.
// { dg-final { scan-assembler-times "DW_TAG_variable\[^.\]*\.ascii \"j.0\"" 4 } }
// PR debug/52260
-// { dg-do compile }
-// { dg-options "-gdwarf-4 -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-gdwarf-4" }
namespace { typedef decltype (nullptr) T1; }
struct B {};
-// { dg-do compile }
-// { dg-options "-gpubnames -gdwarf-4 -fno-debug-types-section -std=c++0x -dA" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-gpubnames -gdwarf-4 -fno-debug-types-section -dA" }
// { dg-final { scan-assembler-times "\.section\[\t \]\[^\n\]*debug_pubnames" 1 } }
// { dg-final { scan-assembler "\"\\(anonymous namespace\\)\\\\0\"+\[ \t\]+\[#;/|@!]+\[ \t\]+external name" } }
// { dg-final { scan-assembler "\"one\\\\0\"+\[ \t\]+\[#;/|@!]+\[ \t\]+external name" } }
-// { dg-do compile }
-// { dg-options "-gpubnames -gdwarf-4 -fdebug-types-section -std=c++0x -dA" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-gpubnames -gdwarf-4 -fdebug-types-section -dA" }
// { dg-final { scan-assembler-times "\.section\[\t \]\[^\n\]*debug_pubnames" 1 } }
// { dg-final { scan-assembler "\"\\(anonymous namespace\\)\\\\0\"+\[ \t\]+\[#;/|@!]+\[ \t\]+external name" } }
// { dg-final { scan-assembler "\"one\\\\0\"+\[ \t\]+\[#;/|@!]+\[ \t\]+external name" } }
-// { dg-do compile }
-// { dg-options "-g -dA -gdwarf-4 -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA -gdwarf-4" }
// { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_reference_type" 1 } }
// { dg-final { scan-assembler-times "DIE\[^\n\r\]*DW_TAG_rvalue_reference_type" 1 } }
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
-// { dg-options "-std=c++0x -g -dA" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA" }
//
// In theory the compiler instantiates count<int, char, long>,
// count<char, long> and count<long>. In practice, only
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
-// { dg-options "-g -dA -std=c++0x -fno-merge-debug-strings" }
-// { dg-do compile }
+// { dg-options "-g -dA -fno-merge-debug-strings" }
+// { dg-do compile { target c++11 } }
// There must be 5 subprograms generated:
// printf(const char*), printf<int, char, int>,
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
-// { dg-options "-std=c++0x -g -dA" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA" }
//
// In theory the compiler instantiates count<int, char, long>,
// count<char, long> and count<long>. In practice, only
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/30161
-// { dg-options "-std=c++0x -g -dA -fno-merge-debug-strings" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -dA -fno-merge-debug-strings" }
// The type M<> should have one DW_TAG_GNU_template_parameter_pack DIE,
// with no DW_AT_name attribute. We don't test the fact that it has no
// PR c++/52637
-// { dg-options "-g -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g" }
template <typename T>
struct C { };
// Test that debugging backends don't crash on NULLPTR_TYPE.
-// { dg-options "-std=c++0x -fabi-version=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=0" }
typedef decltype(nullptr) nullptr_t;
// Red Hat bug 750545
-// { dg-do run { target c++98 } }
+// { dg-do run { target { ! c++11 } } }
class excep {};
class A
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template <unsigned Len, unsigned Align>
struct aligned_storage
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename T>
struct X {
-// { dg-options "-std=c++0x" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
template <class T>
int
-// { dg-options "-std=c++0x" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
using global_vector_type __attribute__((vector_size(16))) = float;
// PR c++/14401
struct { struct { int& i ; } bar ; } foo ; // { dg-error "deleted|uninitialized" "uninit" }
-// { dg-warning "anonymous" "anon" { target c++98 } 3 }
-// { dg-message "should be initialized" "ref-uninit" { target c++98 } 3 }
+// { dg-warning "anonymous" "anon" { target { ! c++11 } } 3 }
+// { dg-message "should be initialized" "ref-uninit" { target { ! c++11 } } 3 }
-// { dg-options "-std=gnu++0x -w" }
-// { dg-do run }
+// { dg-options "-w" }
+// { dg-do run { target c++11 } }
#include<typeinfo>
#include<cassert>
// PR libstdc++/48760
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
constexpr _Complex int i{1,2};
constexpr _Complex int j{3};
// PR c++/57041
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
template<typename T>
union u {
// PR c++/55842
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class=void> struct number {
number() noexcept(noexcept(0)) { }
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
struct S {
// PR c++/56268
-// { dg-options -std=c++11 }
+// { dg-do compile { target c++11 } }
template <class T>
struct A {
// Test for int128 arithmetic conversions.
// { dg-do compile { target int128 } }
-// { dg-options "-std=gnu++11" }
+// { dg-require-effective-target c++11 }
+// { dg-options "" }
template <class T, class U> struct same;
template <class T> struct same<T,T> { };
// PR c++/51365
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A { };
static_assert( ! __is_final (A), "A not final" );
// PR c++/48771
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct NonLiteral {
NonLiteral();
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
struct A
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
template <bool> struct enable_if {};
template <> struct enable_if<true> {typedef void type;};
-// { dg-do run }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
#include <cassert>
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct is_same
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct is_same
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct is_same
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
enum E1 : unsigned { E1_en = 1 };
enum E2 : char { E2_en = 1 };
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
enum E1 : unsigned { E1_en = 1 };
enum E2 : char { E2_en = 1 };
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename T1, typename T2>
struct is_same
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char16_t/char32_t string literals. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x -fshort-wchar" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-fshort-wchar" } */
const char s_0[] = "ab";
const char s_1[] = u"ab"; /* { dg-error "from wide string" } */
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char16_t/char32_t string literals. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
+// { dg-options "" }
const char s_0[] = "ab";
const char s_1[] = u"ab"; /* { dg-error "from wide string" } */
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test unsupported concatenation of char16_t/char32_t* string literals. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
const void *s0 = u"a" "b";
const void *s1 = "a" u"b";
// Test unsupported concatenation of UTF-8 string literals.
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
const void *s0 = u8"a" "b";
const void *s1 = "a" u8"b";
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the char16_t and char32_t promotion rules. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x -Wall -Wconversion -Wsign-conversion -Wsign-promo" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-Wall -Wconversion -Wsign-conversion -Wsign-promo" } */
extern void f_c (char);
extern void fsc (signed char);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test parsing of u and U prefixes when also used as macros. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
#define u L
#define U L
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test parsing of u and U prefixes when also used as macros. */
-/* { dg-do compile } */
-/* { dg-options "-std=gnu++0x" } */
+/* { dg-do compile { target c++11 } } */
#define u L
#define U L
// Contributed by Kris Van Hees <kris.van.hees@oracle.com>
// Test the support for char16_t character constants.
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
void f0 (char16_t c) {}
void f1 (char32_t c) {}
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Ensure that typeinfo data is generated for char16_t/char32_t. */
-/* { dg-do link } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do link { target c++11 } } */
#include <typeinfo>
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Ensure that __CHAR16_TYPE__ and __CHAR32_TYPE__ exist, match the types they
are the underlying data type for. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Ensure that a typedef to char16_t/char32_t issues an error in c++0x. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
typedef short unsigned int char16_t; /* { dg-error "redeclaration" } */
typedef unsigned int char32_t; /* { dg-error "redeclaration" } */
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Ensure that type specifiers are not allowed for char16_t/char32_t. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
signed char16_t c0; /* { dg-error "signed" } */
signed char32_t c1; /* { dg-error "signed" } */
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the support for char16_t character constants. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the support for char16_t* string literals. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test concatenation of char16_t* string literals. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char16_t character constants. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
+
const static char16_t c0 = u''; /* { dg-error "empty character" } */
const static char16_t c1 = u'ab'; /* { dg-warning "constant too long" } */
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the support for char32_t character constants. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test the support for char32_t* string constants. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Test concatenation of char32_t* string literals. */
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -Wall -Werror" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-Wall -Werror" } */
extern "C" void abort (void);
/* Contributed by Kris Van Hees <kris.van.hees@oracle.com> */
/* Expected errors for char32_t character constants. */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
const static char32_t c0 = U''; /* { dg-error "empty character" } */
const static char32_t c1 = U'ab'; /* { dg-warning "constant too long" } */
-// { dg-do run }
+// { dg-do run { target c++11 } }
// { dg-require-iconv "ISO-8859-2" }
-// { dg-options "-std=c++0x -fexec-charset=ISO-8859-2" }
+// { dg-options "-fexec-charset=ISO-8859-2" }
const char *str1 = "h\u00e1\U0000010Dky ";
const char *str2 = "\u010d\u00E1rky\n";
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
const char s0[] = u8"ab";
const char16_t s1[] = u8"ab"; // { dg-error "from non-wide" }
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
typedef signed char __attribute__((vector_size(128) )) vec;
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
typedef double vec __attribute__((vector_size(2*sizeof(double))));
typedef signed char vec2 __attribute__((vector_size(16)));
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
typedef long vec __attribute__((vector_size (2 * sizeof (long))));
constexpr vec v = { 3, 4 };
-/* { dg-do compile } */
-/* { dg-options "-std=gnu++1y -Wsign-conversion" } */
+/* { dg-do compile { target c++1y } } */
+/* { dg-options "-Wsign-conversion" } */
// Ignore warning on some powerpc-linux configurations.
// { dg-prune-output "non-standard ABI extension" }
// Ignore warning on Linux/x86
typedef enum { e } T __attribute__((vector_size(8)));
static void foo(T t) {}
-void bar (T t) {} // { dg-error "no linkage" "" { target c++98 } }
-// { dg-final { scan-assembler-not "globl\[ \t]*_Z3bar" { target { ! c++98 } } } }
+void bar (T t) {} // { dg-error "no linkage" "" { target { ! c++11 } } }
+// { dg-final { scan-assembler-not "globl\[ \t]*_Z3bar" { target c++11 } } }
call<&B2::fn2> (); // { dg-error "linkage|no matching" }
call<&fn3> ();
call<&B1::fn4> ();
- call<&fn5> (); // { dg-error "linkage|no matching" "" { target c++98 } }
+ call<&fn5> (); // { dg-error "linkage|no matching" "" { target { ! c++11 } } }
}
// Test that auto works with VLAs.
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
+// { dg-options "" { target { ! c++1y } } }
void bar(int n)
{
// PR c++/38639
-// { dg-do compile }
-// { dg-options "-fopenmp -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fopenmp" }
template<int> void
foo ()
// copy per shared object.
// { dg-require-effective-target tls }
-// { dg-options "-std=c++11 -fPIC" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fPIC" }
// { dg-final { scan-assembler-not "_ZTW1i@PLT" { target i?86-*-* x86_64-*-* } } }
extern thread_local int i;
-// { dg-options -std=c++0x }
-
struct A
{
int i;
int a = 2;
int b = { 2,3 }; // { dg-error "requires one element in initializer" }
int c = { { 2 } } ; // { dg-error "braces around scalar initializer" }
-int d = {}; // { dg-error "initializer" "" { target c++98 } }
+int d = {}; // { dg-error "initializer" "" { target { ! c++11 } } }
{
int i = { 1 };
int j = { 1, 2 }; /* { dg-error "requires one element" } */
- A a = { 6 }; /* { dg-error "initialize" "" { target c++98 } } */
+ A a = { 6 }; /* { dg-error "initialize" "" { target { ! c++11 } } } */
B b = { 6 }; /* { dg-error "" } */
C c = { 6 }; /* { dg-error "too many initializers" } */
D d = { 6 };
// PR c++/49569
-// { dg-options -std=c++0x }
struct A
{
C(): b() { }
C(const B& b): b(b) { }
};
-
// PR c++/47503
-// { dg-options "-std=c++0x -fno-elide-constructors" }
+// { dg-options "-fno-elide-constructors" }
struct A
{
// PR c++/16489
-// { dg-do compile { target c++98 } }
+// { dg-do compile { target { ! c++11 } } }
const int NULL = 0;
int main() {
struct A1 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const j; // { dg-message "should be initialized" "" { target c++98 } }
+ int const j; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A2 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const volatile i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const volatile i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A3 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A4 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int const& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A5 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S1 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const i; // { dg-message "should be initialized" "" { target c++98 } }
+ T const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S2 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const volatile i; // { dg-message "should be initialized" "" { target c++98 } }
+ T const volatile i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S3 // { dg-error "uninitialized" "" { target c++11 } }
{
- T& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ T& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S4 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const i; // { dg-message "should be initialized" "" { target c++98 } }
- T& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ T const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
+ T& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct X
struct Y11 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Y1 // { dg-error "deleted" "" { target c++11 } }
struct Y22 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Y2 // { dg-error "deleted" "" { target c++11 } }
struct Z1 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z2 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z3 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z4 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z5
union U // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
void f1 ()
struct S // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
class C
struct S2 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
class C2
struct S4 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct C4
struct A1 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const j; // { dg-message "should be initialized" "" { target c++98 } }
+ int const j; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A2 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const volatile i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const volatile i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A3 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A4 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int const& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A5 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S1 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const i; // { dg-message "should be initialized" "" { target c++98 } }
+ T const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S2 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const volatile i; // { dg-message "should be initialized" "" { target c++98 } }
+ T const volatile i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S3 // { dg-error "uninitialized" "" { target c++11 } }
{
- T& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ T& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
template <class T> struct S4 // { dg-error "uninitialized" "" { target c++11 } }
{
- T const i; // { dg-message "should be initialized" "" { target c++98 } }
- T& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ T const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
+ T& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct X
struct Y11 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Y1 // { dg-error "deleted" "" { target c++11 } }
struct Y22 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Y2 // { dg-error "deleted" "" { target c++11 } }
struct Z1 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z2 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z3 // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z4 // { dg-error "uninitialized" "" { target c++11 } }
{
- int& ref; // { dg-message "should be initialized" "" { target c++98 } }
+ int& ref; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct Z5
union U // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
struct A // { dg-error "uninitialized" "" { target c++11 } }
{
- int const i : 2; // { dg-message "should be initialized" "" { target c++98 } }
+ int const i : 2; // { dg-message "should be initialized" "" { target { ! c++11 } } }
};
void f()
-// { dg-do compile }
-// { dg-options "-std=c++11 -O -fdump-ipa-inline" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O -fdump-ipa-inline" }
class Foo
{
-/* { dg-do run } */
+/* { dg-do run { target c++11 } } */
/* There is a devirtualizable call. In PR60306 we deduced wrong target to cxa_pure_virtual.
For gcc 4.10 we temporarily disable the devirtualization. */
-/* { dg-options "-O3 -std=c++11" } */
+/* { dg-options "-O3" } */
#include <vector>
-/* { dg-do compile } */
-/* { dg-options "-O -fipa-cp -std=gnu++0x -fno-early-inlining -fipa-cp-clone --param=ipa-cp-eval-threshold=1" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-O -fipa-cp -fno-early-inlining -fipa-cp-clone --param=ipa-cp-eval-threshold=1" } */
void bar (void *, void *);
// PR c++/49813
// We should handle asinh as a built-in in C++0x mode, even when strict.
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler-not "asinh" } }
#include <math.h>
// PR c++/57102
-// { dg-options "-std=gnu++0x -O2 -fno-inline -fdump-final-insns" }
+// { dg-options "-O2 -fno-inline -fdump-final-insns" }
+// { dg-do compile { target c++11 } }
// { dg-final cleanup-saved-temps }
namespace std
// PR tree-optimization/56381
-// { dg-do compile }
-// { dg-options "-std=c++11 -O2 -w" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -w" }
template <class>
class intrusive_ptr {};
// PR tree-optimization/57661
-// { dg-do compile }
-// { dg-options "-O2 -fno-tree-forwprop -std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O2 -fno-tree-forwprop" }
template <typename>
struct A
// PR ipa/59947
-// { dg-do compile }
-// { dg-options "-O0 -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-O0" }
#pragma GCC optimize ("O2")
template <typename T>
// PR c++/59659
-// { dg-options "-fdump-tree-gimple -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fdump-tree-gimple" }
// { dg-final { scan-tree-dump-times "i = 0" 0 "gimple" } }
// { dg-final { cleanup-tree-dump "gimple" } }
class C
{
- auto union // { dg-error "storage class" "" { target c++98 } }
+ auto union // { dg-error "storage class" "" { target { ! c++11 } } }
{
int a;
}; // { dg-error "multiple|specified" "" { target c++11 } }
// { dg-do compile }
-enum { a = 3 } x; // { dg-warning "anonymous type" "" { target c++98 } }
+enum { a = 3 } x; // { dg-warning "anonymous type" "" { target { ! c++11 } } }
// Origin: PR c++/42634
-// { dg-options "-g -std=c++0x" }
-// { dg-do compile }
+// { dg-options "-g" }
+// { dg-do compile { target c++11 } }
template<typename T> T declval();
// Origin: PR c++/42336
-// { dg-options "-std=c++0x -O2 -g" }
-// { dg-do compile }
+// { dg-options "-O2 -g" }
+// { dg-do compile { target c++11 } }
struct X {
void func() {}
// Origin: PR c++/42797
-// { dg-options "-g -O2 -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-g -O2" }
template<typename _Tp, _Tp __v> struct integral_constant {
static const _Tp value = __v;
/* Verify that final methods are devirtualized */
-/* { dg-do compile } */
-/* { dg-options "-fdump-tree-original -std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-fdump-tree-original" } */
struct A final
{
// PR c++/53186
-// { dg-options "-fdump-tree-original -std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fdump-tree-original" }
struct F1
{
// PR c++/51852
-// { dg-do compile }
-// { dg-options "-std=gnu++11 --param ggc-min-heapsize=0 --param ggc-min-expand=0" }
+// { dg-do compile { target c++11 } }
+// { dg-options "--param ggc-min-heapsize=0 --param ggc-min-expand=0" }
template <typename, typename>
class transformed {};
// PR c++/48369
-// { dg-options -std=gnu++0x }
extern "C" int isnan (double);
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
// Test to allow for va_copy with C++0x standard.
-/* { dg-do compile } */
-/* { dg-options "-std=gnu++11 -Wall" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-Wall" } */
// Check that we can compare vector types that really are the same through
// typedefs.
// PR c++/49691
-// { dg-options -std=c++0x }
struct A { int x; };
A* f();
// PR c++/46282
-// { dg-options -std=c++0x }
template<int>
class A
/* PR c++/43081 */
-/* { dg-do compile } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do compile { target c++11 } } */
struct A
{
};
void method(void) {
- typename Foo<::B>::template Nested<::B> n; // { dg-error "17:'<::' cannot begin" "17-begin" { target c++98 } }
-// { dg-message "17:'<:' is an alternate spelling" "17-alt" { target c++98 } 19 }
-// { dg-error "39:'<::' cannot begin" "39-begin" { target c++98 } 19 }
-// { dg-message "39:'<:' is an alternate spelling" "39-alt" { target c++98 } 19 }
+ typename Foo<::B>::template Nested<::B> n; // { dg-error "17:'<::' cannot begin" "17-begin" { target { ! c++11 } } }
+// { dg-message "17:'<:' is an alternate spelling" "17-alt" { target { ! c++11 } } 19 }
+// { dg-error "39:'<::' cannot begin" "39-begin" { target { ! c++11 } } 19 }
+// { dg-message "39:'<:' is an alternate spelling" "39-alt" { target { ! c++11 } } 19 }
n.template Nested<B>::method();
- n.template Nested<::B>::method(); // { dg-error "22:'<::' cannot begin" "error" { target c++98 } }
-// { dg-message "22:'<:' is an alternate" "note" { target c++98 } 24 }
+ n.template Nested<::B>::method(); // { dg-error "22:'<::' cannot begin" "error" { target { ! c++11 } } }
+// { dg-message "22:'<:' is an alternate" "note" { target { ! c++11 } } 24 }
Nested<B>::method();
- Nested<::B>::method(); // { dg-error "11:'<::' cannot begin" "error" { target c++98 } }
-// { dg-message "11:'<:' is an alternate" "note" { target c++98 } 27 }
+ Nested<::B>::method(); // { dg-error "11:'<::' cannot begin" "error" { target { ! c++11 } } }
+// { dg-message "11:'<:' is an alternate" "note" { target { ! c++11 } } 27 }
}
};
template <int N> struct Foo2 {};
-template struct Foo2<::B>; // { dg-error "21:'<::' cannot begin" "begin" { target c++98 } }
-// { dg-message "21:'<:' is an alternate" "alt" { target c++98 } 33 }
+template struct Foo2<::B>; // { dg-error "21:'<::' cannot begin" "begin" { target { ! c++11 } } }
+// { dg-message "21:'<:' is an alternate" "alt" { target { ! c++11 } } 33 }
// { dg-message "25:type/value mismatch" "mismatch" { target *-*-* } 33 }
// { dg-error "25:expected a constant" "const" { target *-*-* } 33 }
void func(void)
{
- Foo<::B> f; // { dg-error "cannot begin" "begin" { target c++98 } }
-// { dg-message "alternate spelling" "alt" { target c++98 } 42 }
+ Foo<::B> f; // { dg-error "cannot begin" "begin" { target { ! c++11 } } }
+// { dg-message "alternate spelling" "alt" { target { ! c++11 } } 42 }
f.Foo<B>::method();
- f.Foo<::B>::method(); // { dg-error "8:cannot begin" "begin" { target c++98 } }
-// { dg-message "8:alternate spelling" "alt" { target c++98 } 45 }
+ f.Foo<::B>::method(); // { dg-error "8:cannot begin" "begin" { target { ! c++11 } } }
+// { dg-message "8:alternate spelling" "alt" { target { ! c++11 } } 45 }
// Check cases where we the token sequence is the correct one, but there
// was no digraph or whitespaces in the middle, so we should not emit
Foo[::value] = 0;
}
-template struct Foo<::B>; // { dg-error "20:'<::' cannot begin" "begin" { target c++98 } }
-// { dg-message "20:is an alternate" "alt" { target c++98 } 64 }
+template struct Foo<::B>; // { dg-error "20:'<::' cannot begin" "begin" { target { ! c++11 } } }
+// { dg-message "20:is an alternate" "alt" { target { ! c++11 } } 64 }
// On the first error message, an additional note about the use of
// -fpermissive should be present
-// { dg-message "17:\\(if you use '-fpermissive' or '-std=c\\+\\+11', or '-std=gnu\\+\\+11' G\\+\\+ will accept your code\\)" "-fpermissive" { target c++98 } 19 }
+// { dg-message "17:\\(if you use '-fpermissive' or '-std=c\\+\\+11', or '-std=gnu\\+\\+11' G\\+\\+ will accept your code\\)" "-fpermissive" { target { ! c++11 } } 19 }
template <class A>
struct Foo {};
-Foo<::B> foo; // { dg-bogus "error" "error in place of warning" { target c++98 } }
-// { dg-warning "4: '<::' cannot begin a template-argument list" "warning <::" { target c++98 } 11 }
-// { dg-message "4:'<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target c++98 } 11 }
+Foo<::B> foo; // { dg-bogus "error" "error in place of warning" { target { ! c++11 } } }
+// { dg-warning "4: '<::' cannot begin a template-argument list" "warning <::" { target { ! c++11 } } 11 }
+// { dg-message "4:'<:' is an alternate spelling for '.'. Insert whitespace between '<' and '::'" "note <:" { target { ! c++11 } } 11 }
template <const int*> class Helper { };
const int foo = 0;
-typedef Helper<&foo> HelperType; // { dg-error "linkage|type" "" { target c++98 } }
+typedef Helper<&foo> HelperType; // { dg-error "linkage|type" "" { target { ! c++11 } } }
template <int i> struct Y {};
};
-typedef X::template Y<0> y; // { dg-error "template|invalid" "" { target c++98 } }
+typedef X::template Y<0> y; // { dg-error "template|invalid" "" { target { ! c++11 } } }
int main()
{
- typename A<double>::template B<int> b; // { dg-error "template|expected" "" { target c++98 } }
+ typename A<double>::template B<int> b; // { dg-error "template|expected" "" { target { ! c++11 } } }
}
# If a testcase doesn't have special options, use these.
global DEFAULT_CXXFLAGS
if ![info exists DEFAULT_CXXFLAGS] then {
- set DEFAULT_CXXFLAGS " -ansi -pedantic-errors -Wno-long-long"
+ set DEFAULT_CXXFLAGS " -pedantic-errors -Wno-long-long"
}
# The procedures in plugin-support.exp need these parameters.
-/* { dg-do compile } */
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
extern "C" void do_not_remove ();
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-options "-O2 -fno-omit-frame-pointer -fPIC -std=gnu++11" } */
+// { dg-require-effective-target c++11 }
+/* { dg-options "-O2 -fno-omit-frame-pointer -fPIC" } */
typedef int int32;
typedef long long int64;
-/* { dg-do link } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do link { target c++11 } } */
/* { dg-final { simulate-thread } } */
/* { dg-require-effective-target sync_char_short } */
/* { dg-require-effective-target sync_int_long } */
-/* { dg-do link } */
-/* { dg-options "-std=c++0x" } */
+/* { dg-do link { target c++11 } } */
/* { dg-final { simulate-thread } } */
/* { dg-require-effective-target sync_int_long } */
// PR c++/49663
-// { dg-options -std=c++0x }
struct Nosm
{
// PR c++/46903
-// This isn't C++0x code, but it was breaking in C++0x mode.
-// { dg-options -std=c++0x }
struct A {};
struct B {
void fn ()
{
class L {};
- X<L> f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" { target c++98 } }
+ X<L> f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" { target { ! c++11 } } }
}
// PR c++/47808
-// { dg-options -std=c++0x }
+// { dg-options "" }
template <typename T>
inline T abs (T const & x) { return x; }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<class T, T t = (T)0>
struct S
// Contributed by Dodji Seketeli <dodji@redhat.com>
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
struct F { F(int) {}};
// PR c++/47950
-// { dg-options -std=c++0x }
template <typename T> struct empty
{
// PR c++/49176
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
struct A { static int a(); };
// PR c++/47897
-// { dg-options -std=c++0x }
template < typename T, T N >
struct S
// PR c++/48707
-// { dg-options -std=c++0x }
struct A {
static int a();
// PR c++/35828
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template < typename > struct A ;
template < template < typename > class = A >
// Origin PR c++/48574
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/47482
-// { dg-options -std=c++0x }
template<class>
struct K
--- /dev/null
+// PR c++/48212
+
+template < bool > void
+foo ()
+{
+ const bool b =; // { dg-error "" }
+ foo < b > (); // { dg-error "" }
+}
// PR c++/37177
-// { dg-options -std=c++0x }
+// { dg-do compile { target c++11 } }
#include <typeinfo>
// Origin PR c++/47172
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
struct A
{
// Origin: PR c++/48656
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
struct A {
int f();
// PR c++/47511
-// { dg-options -std=c++0x }
namespace N {
template <typename T> bool g( T ) {
// PR c++/48500
-// { dg-options -std=c++0x }
struct linked_ptr {
};
// PR c++/48015
-// { dg-options -std=c++0x }
template <typename T> T f(T);
template <typename T> void g()
template<B* b> class E {};
template<const B* b> void f(D<b> &, C<static_cast<const A*>(b)> &) {} // { dg-error "" "" }
-template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target c++98 } }
+template<const B* b> void g(D<b> &, E<const_cast<B*>(b)> &) {} // { dg-error "" "" { target { ! c++11 } } }
B b;
{
C<static_cast<const A*>(&b)> c; // { dg-error "" }
D<&b> d;
- E<const_cast<B*>(&b)> e; // { dg-error "" "" { target c++98 } }
+ E<const_cast<B*>(&b)> e; // { dg-error "" "" { target { ! c++11 } } }
f(d, c); // { dg-error "" "" { target c++11 } }
g(d, e);
}
// PR c++/49298
-// { dg-options -std=c++0x }
template <class T, int T::*> struct B { };
template <class T> struct A
// PR c++/46552
-// { dg-options -std=c++0x }
struct S
{
struct C
{
- X<A::template B> x; // { dg-error "template" "" { target c++98 } }
+ X<A::template B> x; // { dg-error "template" "" { target { ! c++11 } } }
};
int main()
// PR c++/40944
-// { dg-options -std=c++0x }
-// { dg-do run }
+// { dg-do run { target c++11 } }
template<typename T>
struct make { static T&& it(); };
// PR c++/41927
-// { dg-options "-std=c++0x -Wall" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wall" }
// We were getting a spurious ||/&& warning about the enable_if with the
// source position of d1.
// PR c++/44907
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
#include <utility>
// PR c++/44908
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
#include <utility>
// PR c++/44969
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
template<typename Tp, typename... Args>
class mini_is_constructible
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/42225
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template<class T>
struct A
// Origin: PR c++/46394
-// { dg-options "-std=c++0x" }
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
template<class T>
struct S0
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/40684
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct A
{
// PR c++/48265
-// { dg-options -std=c++0x }
template < int > struct S
{
// Test for CSE of the wrapper function: we should only call it once
// for the two references to ir.
-// { dg-do run }
-// { dg-options "-std=c++11 -O -fno-inline -save-temps" }
+// { dg-do run { target c++11 } }
+// { dg-options "-O -fno-inline -save-temps" }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// { dg-final { scan-assembler-times "call *_ZTW2ir" 1 { xfail *-*-* } } }
// PR c++/55801
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
class C;
// PR c++/58672
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
struct A
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// { dg-require-cxa-atexit "" }
// __cxa_thread_atexit into glibc to get this right.
// { dg-do run { xfail *-*-* } }
-// { dg-options "-std=c++11" }
+// { dg-require-effective-target c++11 }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// with a wrapper.
// { dg-require-effective-target tls }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler-not "_ZTW1i" } }
thread_local int i = 42;
// unit, we build a wrapper but don't bother with an init function.
// { dg-require-effective-target tls }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZTW1i" } }
// { dg-final { scan-assembler-not "_ZTH1i" } }
// { dg-require-alias "" }
// { dg-require-effective-target tls }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-final { scan-assembler "_ZTW1i" } }
// { dg-final { scan-assembler "_ZTH1i" } }
// { dg-require-effective-target tls }
// { dg-require-effective-target fpic }
-// { dg-options "-std=c++11 -fPIC" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fPIC" }
// { dg-final { scan-assembler-not "_ZTW1i@PLT" { target i?86-*-* x86_64-*-* } } }
extern thread_local int i;
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
// The variable should have a guard.
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// Test for cleanups in the main thread without -pthread.
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// Test for cleanups in the main thread without -pthread.
-// { dg-do run }
-// { dg-options "-std=c++11" }
+// { dg-do run { target c++11 } }
// { dg-add-options tls }
// { dg-require-effective-target tls_runtime }
// { dg-require-cxa-atexit "" }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
// The reference temp should be TLS, not normal data.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target tls }
// The reference temp should be TLS, not normal data.
// PR c++/55800
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
// { dg-require-alias "" }
// { dg-require-effective-target tls }
// { dg-final { scan-assembler "_ZTH12foo_instance" { target tls_native } } }
-// { dg-do compile }
-// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm -O -fdump-tree-tmmark -fdump-tree-tmlower" }
struct TrueFalse
{
-// { dg-do compile }
-// { dg-options "-fgnu-tm -std=c++0x" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm" }
// All of these must fail, because they are not constant expressions.
template<typename T> int foo(int x, T t)
-// { dg-do compile }
-// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm -O -fdump-tree-tmmark -fdump-tree-tmlower" }
// Same as noexcept-1.C but all noexcepts are false.
-// { dg-do compile }
-// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm -O -fdump-tree-tmmark -fdump-tree-tmlower" }
// Similar to noexcept-1.C but without an explicit (true) for noexcept.
-// { dg-do compile }
-// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark -fdump-tree-tmlower" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm -O -fdump-tree-tmmark -fdump-tree-tmlower" }
int global;
-// { dg-do compile }
-// { dg-options "-fno-exceptions -fgnu-tm -O -std=c++0x -fdump-tree-tmlower" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fno-exceptions -fgnu-tm -O -fdump-tree-tmlower" }
struct TrueFalse
{
-// { dg-do compile }
-// { dg-options "-std=c++11 -fgnu-tm" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm" }
void foo()
{
-// { dg-do compile }
-// { dg-options "-std=c++11 -fgnu-tm" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm" }
int
foo (void)
-// { dg-do compile }
-// { dg-options "-std=c++11 -fgnu-tm" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm" }
int
foo (void)
-// { dg-do compile }
-// { dg-options "-fgnu-tm -O -std=c++0x -fdump-tree-tmmark" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm -O -fdump-tree-tmmark" }
struct TrueFalse
{
-/* { dg-options "-std=gnu++0x" } */
+// { dg-do compile { target c++11 } }
typedef __SIZE_TYPE__ size_t;
namespace std __attribute__ ((__visibility__ ("default"))) {
-// { dg-do compile }
-// { dg-options "-std=c++0x -fnon-call-exceptions" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fnon-call-exceptions" }
void foo (int *k) noexcept
{
-/* { dg-do run } */
-/* { dg-options "-std=c++0x -fno-tree-forwprop" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-fno-tree-forwprop" } */
typedef __SIZE_TYPE__ size_t;
-/* { dg-options "-std=gnu++0x" } */
+// { dg-do compile { target c++11 } }
struct A
{
-/* { dg-options "-std=c++11" } */
+/* { dg-do compile { target c++11 } } */
void gg();
static __typeof(gg) __gthrw_gg __attribute__((__weakref__("gg")));
-// { dg-do compile }
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
namespace std
{
-/* { dg-do compile } */
-/* { dg-options "-std=gnu++0x -fno-inline" } */
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-fno-inline" } */
/* { dg-add-options bind_pic_locally } */
struct B
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do compile { target c++11 } }
struct Iter
{
-// { dg-do compile }
-// { dg-options "-fprofile-use -std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-fprofile-use" }
class A {
int m_fn1() const;
/* Driver fragment for __builtin_shuffle of any vector shape. */
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
extern "C" void abort(void);
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
typedef unsigned short V __attribute__((vector_size(32)));
typedef V VI;
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
typedef unsigned char V __attribute__((vector_size(16)));
typedef V VI;
-// { dg-options "-std=c++11" }
-// // { dg-do run }
+// // { dg-do run { target c++11 } }
#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8
typedef double V __attribute__((vector_size(16)));
typedef unsigned long long VI __attribute__((vector_size(16)));
-// { dg-options "-std=c++11" }
-// // { dg-do run }
+// // { dg-do run { target c++11 } }
#if __SIZEOF_LONG_LONG__ == 8
typedef unsigned long long V __attribute__((vector_size(16)));
-// { dg-options "-std=c++11" }
-// // { dg-do run }
+// // { dg-do run { target c++11 } }
#if __SIZEOF_FLOAT__ == 4
typedef float V __attribute__((vector_size(8)));
# if __SIZEOF_INT__ == 4
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_INT__ == 4
typedef unsigned int V __attribute__((vector_size(8)));
typedef V VI;
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_DOUBLE__ == 8 && __SIZEOF_LONG_LONG__ == 8
typedef double V __attribute__((vector_size(32)));
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_LONG_LONG__ == 8
typedef unsigned long long V __attribute__((vector_size(32)));
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_FLOAT__ == 4
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_INT__ == 4
typedef unsigned int V __attribute__((vector_size(16)));
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
typedef unsigned short V __attribute__((vector_size(16)));
typedef V VI;
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
typedef unsigned char V __attribute__((vector_size(8)));
typedef V VI;
-// { dg-options "-std=c++11" }
-// { dg-do run }
+// { dg-do run { target c++11 } }
#if __SIZEOF_INT__ == 4
typedef unsigned int V __attribute__((vector_size(32)));
// PR c++/59255
-// { dg-options "-O2 -std=c++11" }
+// { dg-options "-std=c++11 -O2" }
struct S
{
{
for (ORIG i = 0; i < a->len; ++i)
{
- if (FIRST CAST (i) >= CAST (a->len))
+ if (FIRST CAST i >= CAST (a->len))
throw 5;
call (a->data[i]);
}
-/* { dg-do run } */
-/* { dg-options "-fsanitize=shift -w -std=c++11" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-fsanitize=shift -w" } */
int
main (void)
-/* { dg-do run } */
-/* { dg-options "-fsanitize=shift -w -std=c++11" } */
+/* { dg-do run { target c++11 } } */
+/* { dg-options "-fsanitize=shift -w" } */
int
main (void)
-/* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable -std=c++1y" } */
+/* { dg-do run { target c++1y } } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
/* { dg-shouldfail "ubsan" } */
int
// PR c++/48420
-// { dg-do compile { target c++98 } }
+// { dg-do compile { target { ! c++11 } } }
void foo(int* p);
// PR c++/56607
// { dg-do compile { target { { lp64 || ilp32 } || llp64 } } }
-// { dg-options "-O2 -Wdiv-by-zero -std=c++11" }
+// { dg-require-effective-target c++11 }
+// { dg-options "-O2 -Wdiv-by-zero" }
constexpr int sc () { return sizeof (char); }
constexpr int si () { return sizeof (int); }
// PR c++/45894
-// { dg-do compile }
-// { dg-options "-std=c++0x -Wsequence-point" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wsequence-point" }
struct F
{
// Test the declaration of nested lambda function shadows
// a parameter or previous local.
-// { dg-do compile }
-// { dg-options "-std=c++0x -Wshadow" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wshadow" }
struct S {};
int f1(int x) // { dg-message "shadowed declaration" }
// PR c++/55643
-// { dg-do compile }
-// { dg-options "-std=c++11 -Wunused" }
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wunused" }
enum class E { e = 123 };
-/* { dg-do compile } */
+/* { dg-do compile { target { ! c++1y } } } */
/* { dg-options "-pedantic-errors -Wvla" } */
void func (int i)
-// { dg-options "-std=gnu++0x -Wdelete-non-virtual-dtor" }
-// { dg-do compile }
+// { dg-options "-Wdelete-non-virtual-dtor" }
+// { dg-do compile { target c++11 } }
struct polyBase { virtual void f(); };
extern "C" int printf (const char *, ...);
void f() {
- printf("%lf", 0.0); // { dg-warning "%lf" "" { target c++98 } }
+ printf("%lf", 0.0); // { dg-warning "%lf" "" { target { ! c++11 } } }
}
// PR c++/13358: g++ should accept a long long constant sans LL suffix
// if -Wno-long-long is in use
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target int32plus }
-// { dg-options "-std=c++0x -pedantic-errors" }
+// { dg-options "-pedantic-errors" }
void use_longlong ()
// PR c++/13358: g++ should accept a long long constant sans LL suffix
// if -Wno-long-long is in use.
-// { dg-do compile }
+// { dg-do compile { target c++11 } }
// { dg-require-effective-target int32plus }
-// { dg-options "-std=c++0x -pedantic-errors -Wlong-long" }
+// { dg-options "-pedantic-errors -Wlong-long" }
void use_longlong ()
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
// prms-id: 12475
#include <limits.h>
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
// GROUPS passed old-abort
typedef __SIZE_TYPE__ size_t;
typedef void (*RF_Ptr)(void *);
class Thing
{
public:
- typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" "comma" { target c++98 } }
+ typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" "comma" { target { ! c++11 } } }
Thing (ThingType type) : thingType (type) { }
~Thing () { }
private:
class Group
{
public:
- typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" "comma" { target c++98 } }
+ typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" "comma" { target { ! c++11 } } }
Group (GroupType type) : groupType (type), groupCount (0) { }
~Group () { }
void append (Thing* const &entry) { groupCount ++ ; }
{
oneMask = 0x0000FFFF,
twoMask = 0x000F0000,
- thiMask = 0xFFF00000, // { dg-error "comma at end" "" { target c++98 } }
+ thiMask = 0xFFF00000, // { dg-error "comma at end" "" { target { ! c++11 } } }
};
unsigned int foo;
enum foo1_enum
{
ENUM1,
- ENUM2, // { dg-error "comma at end" "" { target c++98 } }
+ ENUM2, // { dg-error "comma at end" "" { target { ! c++11 } } }
};
};
// GROUPS passed enums
enum fig {
figgy,
- pudding, // { dg-error "comma at end" "" { target c++98 } }
+ pudding, // { dg-error "comma at end" "" { target { ! c++11 } } }
};
class X {
friend class A;
enum {
- bEnum = 1, // { dg-error "comma at end" "" { target c++98 } }
+ bEnum = 1, // { dg-error "comma at end" "" { target { ! c++11 } } }
};
int bArray[ bEnum ];
// GROUPS passed initialization
// this should give an error in require_required_type about not
// being allowed to have an initializer list in an argument list.
-int f(int a = {1});// { dg-error "" "" { target c++98 } }
+int f(int a = {1});// { dg-error "" "" { target { ! c++11 } } }
// GROUPS passed initialization
struct CharList { int i; };
-const CharList& terminals = { 1 }; // { dg-error "initializer lists" "" { target c++98 } }
+const CharList& terminals = { 1 }; // { dg-error "initializer lists" "" { target { ! c++11 } } }
public:
enum e {
New // { dg-message "previous" }
- , // { dg-error "comma at end" "" { target c++98 } }
+ , // { dg-error "comma at end" "" { target { ! c++11 } } }
};
static int New(int); // { dg-error "conflicts with a previous" }
// { dg-error "is initialized like a variable" "var" { target *-*-* } 50 }
;
- if (int a[2] = {1, 2}) // { dg-error "extended init" "" { target c++98 } }
+ if (int a[2] = {1, 2}) // { dg-error "extended init" "" { target { ! c++11 } } }
;
}
class bar {
public:
- foo f[3] = { 1, 2, 3 }; // works: f[0] = 1, f[1] = 2, f[2] = 3 // { dg-error "" "" { target c++98 } } ANSI C++ forbids initialization of member f;
+ foo f[3] = { 1, 2, 3 }; // works: f[0] = 1, f[1] = 2, f[2] = 3 // { dg-error "" "" { target { ! c++11 } } } ANSI C++ forbids initialization of member f;
};
class bar2 {
public:
- foo f[3] = { foo(1), foo(2), foo(3) }; // { dg-error "" "" { target c++98 } } ANSI C++ forbids initialization of member f;
+ foo f[3] = { foo(1), foo(2), foo(3) }; // { dg-error "" "" { target { ! c++11 } } } ANSI C++ forbids initialization of member f;
// does not compile -- error: field initializer is not constant
};
};
foo **f2;
-allocate2d(d1, d2, f2);// { dg-error "" "" { target c++98 } }
-ffree(d1, f2);// { dg-error "" "" { target c++98 } }
+allocate2d(d1, d2, f2);// { dg-error "" "" { target { ! c++11 } } }
+ffree(d1, f2);// { dg-error "" "" { target { ! c++11 } } }
}
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
// Test that we properly diagnose an attempt to use an anonymous class
// in declaring an external function.
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
typedef struct {
int i;
} *p;
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
// From: Klaus-Georg Adams <Klaus-Georg.Adams@chemie.uni-karlsruhe.de>
extern "C"
{
// Check that the strlen declaration here is given internal linkage by
// using it as a non-type template argument, and expecting an error.
-template void f<strlen>(); // { dg-error "" "" { target c++98 } } no matching template
+template void f<strlen>(); // { dg-error "" "" { target { ! c++11 } } } no matching template
} S;
struct B: S{
- using S::S; // { dg-error "" "" { target c++98 } } no such field
+ using S::S; // { dg-error "" "" { target { ! c++11 } } } no such field
};
{
enum tern { H, L, X, U };
- vector<tern> ternvec; // { dg-error "" "" { target c++98 } } composed from a local type
+ vector<tern> ternvec; // { dg-error "" "" { target { ! c++11 } } } composed from a local type
}
template void fn(int);
template class S<double>;
template class S<double>; // { dg-error "duplicate explicit instantiation" }
-extern template void f(double); // { dg-error "extern" "" { target c++98 } }
+extern template void f(double); // { dg-error "extern" "" { target { ! c++11 } } }
inline template class S<float>; // { dg-error "inline" } inline not allowed
template <class T>
template<template<class> class>
class Y {
};
-Q::template X<int> x; // { dg-error "template" "" { target c++98 } }
+Q::template X<int> x; // { dg-error "template" "" { target { ! c++11 } } }
int main ()
{
A a;
- return a.template f (0); // { dg-error "template" "" { target c++98 } }
+ return a.template f (0); // { dg-error "template" "" { target { ! c++11 } } }
}
h<(int A::*) &A::i>(); // { dg-error "" "" { xfail c++11 } }
g<(void (A::*)()) &B::f>(); // { dg-error "" "" { xfail { c++11 && { aarch64*-*-* arm*-*-* mips*-*-* } } } }
h<(int A::*) &B::j>(); // { dg-error "" }
- g<(void (A::*)()) 0>(); // { dg-error "" "" { target c++98 } }
- h<(int A::*) 0>(); // { dg-error "" "" { target c++98 } }
+ g<(void (A::*)()) 0>(); // { dg-error "" "" { target { ! c++11 } } }
+ h<(int A::*) 0>(); // { dg-error "" "" { target { ! c++11 } } }
return 0;
}
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
template <class X, int n> X f (auto X (*x)[n]) { return (*x)[n/2]; }
extern int i[30];
-// { dg-do assemble { target c++98 } }
+// { dg-do assemble { target { ! c++11 } } }
template <class X, int n> X f (auto X (*x)[n]) { return (*x)[n/2]; }
extern int i[30], i2[33];
# if there's a dg-options line.
if ![search_for $test "-std=*++"] {
if [search_for $test "dg-options"] {
- set option_list { -std=gnu++98 -std=gnu++11 }
+ set option_list { -std=gnu++98 -std=gnu++11 -std=gnu++1y }
} else {
- set option_list { -std=c++98 -std=c++11 }
+ set option_list { -std=c++98 -std=c++11 -std=c++1y }
}
} else {
set option_list { "" }
return 0
}
-# Check which language standard is active by checking for the presence of
-# one of the C++11 -std flags. This assumes that the default for the
-# compiler is C++98, and that there will never be multiple -std= arguments
-# on the command line.
-proc check_effective_target_c++11 { } {
+# Check whether the current active language standard supports the features
+# of C++11/C++1y by checking for the presence of one of the -std
+# flags. This assumes that the default for the compiler is C++98, and that
+# there will never be multiple -std= arguments on the command line.
+proc check_effective_target_c++11_only { } {
if ![check_effective_target_c++] {
return 0
}
return [check-flags { { } { } { -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11 } }]
}
+proc check_effective_target_c++11 { } {
+ if [check_effective_target_c++11_only] {
+ return 1
+ }
+ return [check_effective_target_c++1y]
+}
+proc check_effective_target_c++11_down { } {
+ if ![check_effective_target_c++] {
+ return 0
+ }
+ return ![check_effective_target_c++1y]
+}
-proc check_effective_target_c++1y { } {
+proc check_effective_target_c++1y_only { } {
if ![check_effective_target_c++] {
return 0
}
- return [check-flags { { } { } { -std=c++1y -std=gnu++1y } }]
+ return [check-flags { { } { } { -std=c++1y -std=gnu++1y -std=c++14 -std=gnu++14 } }]
+}
+proc check_effective_target_c++1y { } {
+ return [check_effective_target_c++1y_only]
}
-proc check_effective_target_c++98 { } {
+proc check_effective_target_c++98_only { } {
if ![check_effective_target_c++] {
return 0
}
- return [check-flags { { } { } { } { -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11 -std=c++1y -std=gnu++1y } }]
+ return ![check_effective_target_c++11]
}
# Return 1 if expensive testcases should be run.