Commit 4b2e63de by Jason Merrill Committed by Jason Merrill

g++-dg.exp (g++-dg-runtest): Run tests in C++1y mode, too.

	* 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
parent 968b3503

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

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
......
......@@ -6,9 +6,9 @@ namespace N1 {
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;
......@@ -22,10 +22,10 @@ namespace N2 {
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;
......@@ -38,9 +38,9 @@ namespace N3 {
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;
......@@ -54,10 +54,10 @@ namespace N4 {
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;
......
......@@ -3,7 +3,7 @@
// 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;
......@@ -14,7 +14,7 @@ void f(B) { }
struct C
{
typedef struct { }* D;
typedef enum { }* E;
typedef enum { e }* E;
};
// { dg-final { scan-assembler "_Z2g1PN1CUt_E" } }
......@@ -30,7 +30,7 @@ void h2(T t) { }
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
......
......@@ -19,7 +19,7 @@ A<int> A1;
// 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>
......@@ -16,13 +15,13 @@ const std::type_info &t2 = typeid (auto *); // { dg-error "auto" }
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" }
};
......@@ -42,7 +41,7 @@ bool d = (auto (A::*)()) 0; // { 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" }
......@@ -79,10 +78,10 @@ enum struct D : auto * { FF = 0 }; // { dg-error "must be an integral type|decl
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
......@@ -99,8 +98,8 @@ baz (int i, ...)
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" }
......@@ -117,8 +116,8 @@ template <auto V = 4> struct G {}; // { dg-error "auto" }
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();
......
......@@ -2,8 +2,7 @@
// 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; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment