OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-src/gcc-4.2.2/gcc/testsuite/g++.dg/other
    from Rev 149 to Rev 154
    Reverse comparison

Rev 149 → Rev 154

/return1.C
0,0 → 1,15
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 12 Oct 2005 <nathan@codesourcery.com>
 
// PR 21117:ICE after error
// Origin: Andrew Pinski <pinskia@gcc.gnu.org>
 
struct wxString;
struct wxString* wxGetEmptyString();
 
struct wxString GetHeader() // { dg-error "return type" "" }
{
return *wxGetEmptyString();
}
 
 
return1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vthunk1.C =================================================================== --- vthunk1.C (nonexistent) +++ vthunk1.C (revision 154) @@ -0,0 +1,26 @@ +// PR c++/12007 Multiple inheritance float pass by value fails +// { dg-do run } + +extern "C" void abort (void); + +class gvImpl +{ +public: + virtual void PutVal(float value){} +}; + +class foo { public: virtual void Bar(){} }; + +class myGv: public foo, public gvImpl +{ + void PutVal(float value){ if (value != 3.14159f) abort (); } +}; + +myGv x; +gvImpl* object = &x; + +int main() +{ + object->PutVal(3.14159f); + return 0; +}
vthunk1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array4.C =================================================================== --- array4.C (nonexistent) +++ array4.C (revision 154) @@ -0,0 +1,19 @@ +// PR C++/28906: new on an array causes incomplete arrays to +// become complete with the wrong size. +// The sizeof machineMain should be 5 and not 100. +// { dg-do run } + + +extern char machineMain[]; +void sort (long len) +{ + new char[100]; +} +char machineMain[] = "main"; +int main(void) +{ + if (sizeof(machineMain)!=sizeof("main")) + __builtin_abort(); +} + +
array4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: java2.C =================================================================== --- java2.C (nonexistent) +++ java2.C (revision 154) @@ -0,0 +1,11 @@ +// PR c++/??? +// { dg-do compile } + +extern "Java" +{ + struct A {}; +} + +typedef void* jclass; + +A* p = new A; // { dg-error "class\\$" }
java2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: packed1.C =================================================================== --- packed1.C (nonexistent) +++ packed1.C (revision 154) @@ -0,0 +1,29 @@ +// { dg-do run { xfail arm-*-* sh-*-* ia64-hp-hpux* } } + +// NMS:2003-04-21 this fails on strict aligned architectures again, +// the patch was reverted because it broke something more important. + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 8 Aug 2002 + +// WRS SPR 63496, lost packed attribute when accessing a packed +// field. This matters on aligned architectures like sh + +struct thing { int m; }; + +struct pod + { + char a; + thing m __attribute__ ((packed)); // { dg-warning "attribute ignored" "" { target default_packed } } + }; + +int main () +{ + thing t; + pod p; + + p.m = t; /* runtime bus error here */ + + return 0; + +}
packed1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: gc1.C =================================================================== --- gc1.C (nonexistent) +++ gc1.C (revision 154) @@ -0,0 +1,49 @@ +// This test failed with GGC_ALWAYS_COLLECT because not all unparsed +// inline methods were registered with GC. +// { dg-do compile } + +const char *foo () +{ + struct A + { + const char *a1 () + { + return "a1"; + } + const char *a2 () + { + struct B + { + const char *b1 () + { + return "b1"; + } + const char *b2 () + { + struct C + { + const char *c1 () + { + return "c1"; + } + const char *c2 () + { + return "c2"; + } + }; + return "b2"; + } + const char *b3 () + { + return "b3"; + } + }; + return "a2"; + } + const char *a3 () + { + return "a3"; + } + }; + return "foo"; +}
gc1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operator1.C =================================================================== --- operator1.C (nonexistent) +++ operator1.C (revision 154) @@ -0,0 +1,9 @@ +// PR c++/27547 +// { dg-do compile } + +int operator=(int); // { dg-error "member function" } + +void foo() +{ + operator=(0); // { dg-error "not defined" } +}
operator1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon3.C =================================================================== --- anon3.C (nonexistent) +++ anon3.C (revision 154) @@ -0,0 +1,7 @@ +// pr c++/15049 +// Origin: Matt Austern +// Test that we can declare a global variable whose type is anonymous. + +// { dg-do compile } + +enum { a = 3 } x; // { dg-warning "anonymous type" }
anon3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typedef1.C =================================================================== --- typedef1.C (nonexistent) +++ typedef1.C (revision 154) @@ -0,0 +1,7 @@ +// PR c++/27572 +// { dg-do compile } + +void f1(typedef) {} // { dg-error "no type|typedef declaration" } +void f2(typedef x) {} // { dg-error "no type|typedef declaration" } +void f3(typedef x[]) {} // { dg-error "no type|typedef declaration" } +void f4(typedef int x) {} // { dg-error "typedef declaration" }
typedef1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: switch1.C =================================================================== --- switch1.C (nonexistent) +++ switch1.C (revision 154) @@ -0,0 +1,20 @@ +// { dg-do compile } +// Contributed by: Nick Savoiu +// PR c++/14250: Incomplete type in switch statement + +template +struct A { + operator int(); +}; + +struct C1 { + static A t1; + + void fun() + { + switch(t1) + { + default: break; + } + } +};
switch1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: do1.C =================================================================== --- do1.C (nonexistent) +++ do1.C (revision 154) @@ -0,0 +1,13 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 16 Sep 2002 + +// PR 7640. ICE. + +void init () +{ + do { } while (0) + obj = 0; // { dg-error "expected|not declared" "" } + +}
do1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr25632.C =================================================================== --- pr25632.C (nonexistent) +++ pr25632.C (revision 154) @@ -0,0 +1,17 @@ +/* PR c++/25632 */ + +/* { dg-do compile } */ + +struct sockaddr_un { + char sun_path[1]; +}; +const unsigned SI_SUN_HEAD_LEN = (long)(((struct sockaddr_un *)0)->sun_path); +int SiGetPeerName () +{ + return SI_SUN_HEAD_LEN; +} +int SiAccept () +{ + return SI_SUN_HEAD_LEN; +} +
pr25632.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: abstract1.C =================================================================== --- abstract1.C (nonexistent) +++ abstract1.C (revision 154) @@ -0,0 +1,59 @@ +// { dg-do compile } +// Contributed by , +// , +// +// c++/9256: Make sure that a pointer to an array of abstract elements +// cannot be created, not even during template substitution (DR337). + +struct Abstract { virtual void f() = 0; }; // { dg-error "" } +struct Complete { void f(); }; + + +/* + * TEST 1 + * Arrays of abstract elements cannot be declared. + */ + +Abstract a0[2]; // { dg-error "" } +Abstract (*a1)[2]; // { dg-error "" } +Abstract (**a2)[2]; // { dg-error "" } +Abstract (***a3)[2]; // { dg-error "" } +Abstract *a4; +Abstract *a5[2]; +Abstract (*a6[2])[2]; // { dg-error "" } +Abstract **a7[2]; +Abstract *(*a8[2])[2]; +Abstract (**a9[2])[2]; // { dg-error "" } + +/* + * TEST 2 + * If a pointer to an array of abstract elements is created during template + * instantiation, an error should occur. + */ + +template struct K { + T (*a)[2]; // { dg-error "abstract class type" } +}; + +template struct K; // { dg-error "from here" } + + + +/* + * TEST 3 + * Deducing an array of abstract elements during type deduction is a silent + * failure (rejects overload). + */ + +template struct StaticAssert; +template <> struct StaticAssert {}; + +typedef char Yes; +typedef struct { char x[2]; } No; + +template No is_abstract(U (*k)[1]); +template Yes is_abstract(...); + +StaticAssert(0)) == sizeof(Yes)> b1; +StaticAssert(0)) == sizeof(No)> b2; +StaticAssert(0)) == sizeof(No)> b3;
abstract1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: unused1.C =================================================================== --- unused1.C (nonexistent) +++ unused1.C (revision 154) @@ -0,0 +1,48 @@ +/* { dg-do compile } */ +/* { dg-options "-g" } */ +/* { dg-skip-if "" { { hppa*-*-hpux* *-*-solaris2.[56]* } && { ! hppa*64*-*-* } } { "*" } { "" } } */ + +/* Make sure we didn't eliminate casted types because we thought they were + unused. */ + +void *voidp; + +struct foo { int i; }; +int bar (void) +{ + return ((struct foo *)0x1234)->i; +} + +struct boo { int i; }; +int bar2 (void) +{ + return reinterpret_cast(0xC0FFEE)->i; +} + +struct cue { int i; }; +int bar3 (void) +{ + return static_cast(voidp)->i; +} + +class printer { public: int i; }; +const printer *dotmatrix; +int bar4 (void) +{ + return const_cast(dotmatrix)->i; +} + +class class1 { virtual ~class1(); } *c1; +class class2 : class1 { char j; }; +int bar5 (void) +{ + if (dynamic_cast (c1)) + return 5; + else + return 6; +} +/* { dg-final { scan-assembler "foo" } } */ +/* { dg-final { scan-assembler "boo" } } */ +/* { dg-final { scan-assembler "cue" } } */ +/* { dg-final { scan-assembler "(string|ascii?)z?\t\"class2(\"|\\\\000)" } } */ +/* { dg-final { scan-assembler "(string|ascii?)z?\t\"printer(\"|\\\\000)" } } */
unused1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: first-global.C =================================================================== --- first-global.C (nonexistent) +++ first-global.C (revision 154) @@ -0,0 +1,4 @@ +/* { dg-do compile } */ +/* { dg-final { scan-assembler "_GLOBAL__I_foobar" } } */ +struct foo { foo (); }; +foo foobar;
first-global.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init2.C =================================================================== --- init2.C (nonexistent) +++ init2.C (revision 154) @@ -0,0 +1,49 @@ +// { dg-do run } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 20 Dec 2001 + +// PR 160. Wrong code emitted for some reference initializers. + +void Foo () +{ +} + +int fail; + +class C +{ + public: + int m; + int &r; + + C () ; +}; + +C::C () + : m (1), r ((Foo (), m)) +{ + m = 10; + + if (r != m) + fail = 1; + else if (&m != &r) + fail = 2; +} +int main () +{ + int m (1); + int &r ((Foo (),m)); + + m = 10; + if (r != m) + fail = 3; + else if (&r != &m) + fail = 4; + + if (!fail) + { + C c; + } + return fail; +}
init2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: i386-2.C =================================================================== --- i386-2.C (nonexistent) +++ i386-2.C (revision 154) @@ -0,0 +1,12 @@ +/* Test that {,x,e,p}mmintrin.h and mm_malloc.h are + usable with -pedantic-errors. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-pedantic-errors -msse3" } */ + +#include +#include +#include +#include +#include + +int dummy;
i386-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static11.C =================================================================== --- static11.C (nonexistent) +++ static11.C (revision 154) @@ -0,0 +1,34 @@ +// This is a copy of g++.old-deja/g++.pt/static11.C which at one +// time got a SEGV for mmix-knuth-mmixware when compiled with +// -da (or either -dj or -df). +// { dg-do compile } +// { dg-options "-da" } + +extern "C" void _exit (int); + +int r = 1; + +struct A +{ + void f(){}; + A(){ ++r; } + ~A(){ r -= 2; _exit (r); } +}; + +template +struct C +{ + C(){ a.f(); } + static A a; +}; + +template A C::a; +typedef C B; + +int main() +{ + C c; + return r; +} + +// { dg-final { cleanup-rtl-dump "*" } }
static11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offsetof1.C =================================================================== --- offsetof1.C (nonexistent) +++ offsetof1.C (revision 154) @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 14 Aug 2002 + +// PR c++ 7598, offsetof broke +// PR c++ 11072, DR 273's solution is broken + +#include + +struct F +{ + char i; + char j; +}; + +static int ary[offsetof(F, j)];
offsetof1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash-1.C =================================================================== --- crash-1.C (nonexistent) +++ crash-1.C (revision 154) @@ -0,0 +1,3 @@ + +void f() { return 0; } // { dg-error "return-statement" } +
crash-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: label1.C =================================================================== --- label1.C (nonexistent) +++ label1.C (revision 154) @@ -0,0 +1,7 @@ +//PR c++/27820 + +void foo() +{ + L: L: ; // { dg-error "duplicate label" } +} +
label1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bitfield1.C =================================================================== --- bitfield1.C (nonexistent) +++ bitfield1.C (revision 154) @@ -0,0 +1,9 @@ +// { dg-options "-w" } + +union u1 { + char m1 : 16; +} x; + +int main () { + x.m1 = 256; +}
bitfield1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ellipsis1.C =================================================================== --- ellipsis1.C (nonexistent) +++ ellipsis1.C (revision 154) @@ -0,0 +1,12 @@ +// PR c++/26291 +// { dg-do compile } + +struct A +{ + A& operator= (A,...); // { dg-error "variable number of arguments" } + A operator+ (...); // { dg-error "variable number of arguments" } + operator int(...); // { dg-error "variable number of arguments" } + int operator() (...); +}; + +A operator- (A,...); // { dg-error "variable number of arguments" }
ellipsis1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stdarg2.C =================================================================== --- stdarg2.C (nonexistent) +++ stdarg2.C (revision 154) @@ -0,0 +1,12 @@ +// PR c++/11929 +// Bug: We were complaining about the call to va_start because o is of +// non-POD type. + +struct s { + s(int); +}; + +void test(s o, ...) { + __builtin_va_list varg; + __builtin_va_start(varg, o); +}
stdarg2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default3.C =================================================================== --- default3.C (nonexistent) +++ default3.C (revision 154) @@ -0,0 +1,109 @@ +// PR c++/16829 +// { dg-do "compile" } + +void f1(int = 0, int); // { dg-error "default" } + +void f2(int = 0, int) {} // { dg-error "default" } + +void f3(int, int); +void f3(int = 0, int); // { dg-error "default" } + +void f4(int, int); +void f4(int = 0, int) {} // { dg-error "default" } + +void f5(); +void f5(int = 0, int); // { dg-error "default" } + +void f6(); +void f6(int = 0, int) {} // { dg-error "default" } + +template void g1(int = 0, int); // { dg-error "default" } + +template void g2(int = 0, int) {} // { dg-error "default" } + +template void g3(int, int); +template void g3(int = 0, int); // { dg-error "default" } + +template void g4(int, int); +template void g4(int = 0, int) {} // { dg-error "default" } + +template void g5(); +template void g5(int = 0, int); // { dg-error "default" } + +template void g6(); +template void g6(int = 0, int) {} // { dg-error "default" } + +template void g7(T, T) {} +template void g7(T* = 0, T*) {} // { dg-error "default" } + + +struct A +{ + void F1(int = 0, int); // { dg-error "default" } + + void F2(int = 0, int) {} // { dg-error "default" } + + void F3(int, int); + + void F4(); + void F4(int = 0, int); // { dg-error "default" } + + void F5(); + void F5(int = 0, int) {} // { dg-error "default" } + + template void G1(int = 0, int); // { dg-error "default" } + + template void G2(int = 0, int) {} // { dg-error "default" } + + template void G3(int, int); + + template void G4(); + template void G4(int = 0, int); // { dg-error "default" } + + template void G5(); + template void G5(int = 0, int) {} // { dg-error "default" } + + template void G6(T, T) {} + template void G6(T* = 0, T*) {} // { dg-error "default" } +}; + +void A::F3(int = 0, int) {} // { dg-error "default" } + +template void A::G3(int = 0, int) {} // { dg-error "default" } + + +template struct B +{ + void F1(int = 0, int); // { dg-error "default" } + + void F2(int = 0, int) {} // { dg-error "default" } + + void F3(int, int); + + void F4(); + void F4(int = 0, int); // { dg-error "default" } + + void F5(); + void F5(int = 0, int) {} // { dg-error "default" } + + template void G1(int = 0, int); // { dg-error "default" } + + template void G2(int = 0, int) {} // { dg-error "default" } + + template void G3(int, int); + + template void G4(); + template void G4(int = 0, int); // { dg-error "default" } + + template void G5(); + template void G5(int = 0, int) {} // { dg-error "default" } + + template void G6(T, T) {} + template void G6(T* = 0, T*) {} // { dg-error "default" } +}; + +template +void B::F3(int = 0, int) {} // { dg-error "default" } + +template template +void B::G3(int = 0, int) {} // { dg-error "default" }
default3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error1.C =================================================================== --- error1.C (nonexistent) +++ error1.C (revision 154) @@ -0,0 +1,15 @@ +// { dg-do compile } + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 18 Dec 2001 + +// PR 90, stupid error message `(this + 160)' + +class foo { + public: + int fudge[40]; + int bar [40]; + inline int access(int i) { + return bar(i); // { dg-error "cannot be used as a function" "" } + } +};
error1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default7.C =================================================================== --- default7.C (nonexistent) +++ default7.C (revision 154) @@ -0,0 +1,20 @@ +/* { dg-do assemble } */ +/* { dg-options "-O1" }*/ +// This was PR C++/31165 +// We used to copy the whole decl when we just wantted to +// unshare some expressions for the default argument. +class string { + char *ptr; + int len; + int sz; +}; +class cset { } _cset_init; +string an_empty_string; +void f(string& = an_empty_string); +void +h (void ) +{ +f(); +} + +
default7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: PR23205.C =================================================================== --- PR23205.C (nonexistent) +++ PR23205.C (revision 154) @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */ +/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ + +const int foobar = 4; +int foo () +{ + return foobar + 1; +} + +int main() +{ + int i; + i = foo(); + return i; +} + +/* { dg-final { scan-assembler ".stabs.*foobar:c=i" } } */
PR23205.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error5.C =================================================================== --- error5.C (nonexistent) +++ error5.C (revision 154) @@ -0,0 +1,13 @@ +// { dg-do compile } +// Origin: Wolfgang Bangerth +// PR c++/11106: Error message gives partially mangled operator name + +template struct S { + struct I {}; +}; + +template struct S2 : S { + using S::operator typename S::I*; // { dg-error "operator S\\" "" } +}; + +template struct S2; // { dg-error "instantiated" "" }
error5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: large-size-array.C =================================================================== --- large-size-array.C (nonexistent) +++ large-size-array.C (revision 154) @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +#include + +#ifdef __LP64__ +#define DIM UINT_MAX>>1 +#else +#define DIM USHRT_MAX>>1 +#endif + +int +sub (int *a) +{ + return a[0]; +} + +int +main (void) +{ + int a[DIM][DIM]; /* { dg-error "size of array 'a' is too large" } */ + return sub (&a[0][0]); /* { dg-error "declared" } */ +} + +
large-size-array.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vararg-1.C =================================================================== --- vararg-1.C (nonexistent) +++ vararg-1.C (revision 154) @@ -0,0 +1,20 @@ +// C++/15119 +// This ICEd in substitute_placeholder_in_expr because it did not +// implement the 4 element trees. +// Orginal test by: +// Reduced by: +/* { dg-do compile } */ + +template +const T& xmin(const T& a, const T& b); + +void bar (char *, ...); + +char const* descs[4]; + +int main() { + int t = 1; + char buf[100]; + bar( buf, descs[ xmin(t-1,4) ], 0 ); + return 0; +}
vararg-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: incomplete1.C =================================================================== --- incomplete1.C (nonexistent) +++ incomplete1.C (revision 154) @@ -0,0 +1,7 @@ +// PR c++/23089 +// Origin: Flash Sheridan +// ICE on incomplete type +// { dg-do compile } +// { dg-options "-O" } + +void foo(struct A) {} // { dg-error "incomplete type|forward declaration" }
incomplete1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr28114.C =================================================================== --- pr28114.C (nonexistent) +++ pr28114.C (revision 154) @@ -0,0 +1,9 @@ + +// Test to make sure we do not ICE on this invalid program. + +template void foo(struct {}*); // { dg-error "" } + +void bar() +{ + foo<0>(0); // { dg-error "" } +}
pr28114.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error9.C =================================================================== --- error9.C (nonexistent) +++ error9.C (revision 154) @@ -0,0 +1,20 @@ +// { dg-options -Wall } + +// Copyright (C) 2004 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 27 Sept 2004 + +// Origin: v.haisman@sh.cvut.cz +// Bug 17681: bad diagnostic text. + +struct A +{ }; + +struct B +{ }; + +struct C : public B, public A +{ + C () // { dg-warning "when initialized" "" } + : A(), B() // { dg-warning "base .\[AB\]." "" } + { } +};
error9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: void1.C =================================================================== --- void1.C (nonexistent) +++ void1.C (revision 154) @@ -0,0 +1,16 @@ +// PR c++/9278 +// { dg-do compile } + +typedef void VOID; + +int foo(void); +int bar(VOID); // { dg-error "type|invalid use" } + +template int foo(void); +template int bar(VOID); // { dg-error "type|invalid use" } + +struct A +{ + int foo(void); + int bar(VOID); // { dg-error "type|invalid use" } +};
void1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: qual1.C =================================================================== --- qual1.C (nonexistent) +++ qual1.C (revision 154) @@ -0,0 +1,11 @@ +// PR c++/28257 +// { dg-do compile } + +struct A +{ + int i; + void foo() + { + int A::i = i; // { dg-error "qualified" } + } +};
qual1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: component1.C =================================================================== --- component1.C (nonexistent) +++ component1.C (revision 154) @@ -0,0 +1,29 @@ +// { dg-do compile } + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 28 Dec 2001 + +// PR 5123. ICE + +struct C { + template void f(T); + void g (); + void g (int); +}; + +void Foo () { + C c; + + (c.g) (); + (c.f) (1); + + (c.f) (2); + + c.g; // { dg-error "statement cannot resolve" "" } + c.f; // { dg-error "statement cannot resolve" "" } + c.f; // { dg-error "statement cannot resolve" "" } + + c.g == 1; // { dg-error "invalid" "" } + c.f == 1; // { dg-error "invalid" "" } + c.f == 1; // { dg-error "invalid" "" } +}
component1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access3.C =================================================================== --- access3.C (nonexistent) +++ access3.C (revision 154) @@ -0,0 +1,13 @@ +// { dg-do compile } +// { dg-options "-fno-access-control" } + +// PR c++/20022 + +// Make sure -fno-access-control doesn't crash, and actually grants at +// least some access. + +class B { + enum A {}; +}; + +B::A r;
access3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum1.C =================================================================== --- enum1.C (nonexistent) +++ enum1.C (revision 154) @@ -0,0 +1,19 @@ +// PR c++/6037 +// This testcase ICEd because start_enum expected pushtag to insert +// the tag always into current binding level. + +struct A +{ + ~A () { } +}; + +struct B +{ + void foo () + { + switch (0) { default: ; } + A a; + enum C { }; + (void) a; + } +};
enum1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem3.C =================================================================== --- ptrmem3.C (nonexistent) +++ ptrmem3.C (revision 154) @@ -0,0 +1,14 @@ +// Bug: The double cast had an TREE_INT_CST_HIGH of 0, while the single +// cast had -1, so the comparison failed. + +// { dg-do run } + +struct A { }; + +typedef int A::* aip; +typedef long A::* alp; + +int main() +{ + return ((aip)(alp)0 != (aip)0); +}
ptrmem3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cxa-atexit1.C =================================================================== --- cxa-atexit1.C (nonexistent) +++ cxa-atexit1.C (revision 154) @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options "-O2 -fuse-cxa-atexit" } + +# 1 "cxa-atexit1.C" +struct A +{ + struct B + { + B (); + ~B (); + }; +}; +static A::B b; +# 1 "cxa-atexit1.h" 1 +#pragma interface +template struct C +{ + ~C (void); +}; +struct D : public C +{ + D (void) : C () { } +}; +# 55 "cxa-atexit1.C" 2 + +// { dg-final { scan-assembler-not ".gnu.linkonce.t.__tcf_" } }
cxa-atexit1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend1.C =================================================================== --- friend1.C (nonexistent) +++ friend1.C (revision 154) @@ -0,0 +1,12 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 10 Oct 2001 + +// Bug 4476. We tangled up inline friends and pure virtuals during +// class definition. + +struct A { + friend void f () { } + void g (A a) { } +};
friend1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: unreachable1.C =================================================================== --- unreachable1.C (nonexistent) +++ unreachable1.C (revision 154) @@ -0,0 +1,11 @@ +// PR middle-end/17827 +// Origin: Andre Woebbeking +// Testcase by Volker Reichelt +// { dg-do compile } + +void foo() +{ + if (false) + if (int i=0) + int j=i; +}
unreachable1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem7.C =================================================================== --- ptrmem7.C (nonexistent) +++ ptrmem7.C (revision 154) @@ -0,0 +1,4 @@ +// PR c++/27447 +// { dg-do compile } + +void (A::* p)(); // { dg-error "declared|token" }
ptrmem7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: s390-1.C =================================================================== --- s390-1.C (nonexistent) +++ s390-1.C (revision 154) @@ -0,0 +1,32 @@ +// { dg-do compile { target s390x-*-* } } +// { dg-options "-O3 -fPIC" } + +class A +{ +public: + void f (void) { _M_a = 0; } + void g (void) { _M_a = 1; } + void h (void); + +private: + int _M_a; +}; + +class B : virtual public A +{ +}; + +void +test (B& x) +{ + for (int i = 0; i < 17; i++) + { + x.f (); + (x.*&A::g) (); + x.h (); + } +} + +// Check that every call to A::g goes via the PLT. +// { dg-final { scan-assembler-not "brasl\[^@\]*\n" } } +
s390-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error12.C =================================================================== --- error12.C (nonexistent) +++ error12.C (revision 154) @@ -0,0 +1,9 @@ +//PR c++/28292 + +extern "Java" +{ + struct A + { + void foo(void; // { dg-error "before|incomplete type|invalid use" } + }; +}
error12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array1.C =================================================================== --- array1.C (nonexistent) +++ array1.C (revision 154) @@ -0,0 +1,10 @@ +// Test typeid of multidimensional array with no bounds. +// { dg-do compile } + +#include + +int main() +{ + const char *s = typeid(double[][]).name(); // { dg-error "bounds|confused" } + return 0; +}
array1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error16.C =================================================================== --- error16.C (nonexistent) +++ error16.C (revision 154) @@ -0,0 +1,14 @@ +// PR c++/17763 + +template struct Outer { + struct Inner {}; + Inner foo(); +}; + +typedef int X; +typedef Outer XOuter; + +int main() { + Outer ab; + ab.foo() == 1; // { dg-error "ab.Outer" } +}
error16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array5.C =================================================================== --- array5.C (nonexistent) +++ array5.C (revision 154) @@ -0,0 +1,9 @@ +// Check to make sure changing from an incomplete +// array type to a complete one does not change other +// incomplete array type's bounds. +// { dg-do compile } + +extern unsigned char xvalue_store[]; +extern unsigned char xvalue_store1[]; +unsigned char xvalue_store[7]; +unsigned char xvalue_store1[9];
array5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: field1.C =================================================================== --- field1.C (nonexistent) +++ field1.C (revision 154) @@ -0,0 +1,25 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 9 Jul 2003 + +// PR c++ 9483. accepted fields with same name as class + +struct test +{ + char test; // { dg-error "with same name as class" "" } + test(); +}; + +template struct X +{ + char X; // { dg-error "with same name as class" "" } + X (); +}; + +template <> struct X { + char X; // { dg-error "with same name as class" "" } + X(); +}; + +X i; // { dg-error "instantiated from" "" }
field1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: constref1.C =================================================================== --- constref1.C (nonexistent) +++ constref1.C (revision 154) @@ -0,0 +1,16 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Matt Austern 12 Sep 2002 + +// Make sure that we can pass a cast-expression as an argument that's +// passed by const reference. + +void bar (const long&) +{ } + +void foo (int x) +{ + bar ((long) x); +} +
constref1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual1.C =================================================================== --- virtual1.C (nonexistent) +++ virtual1.C (revision 154) @@ -0,0 +1,7 @@ +// PR c++/26070 +// { dg-do compile } + +struct A +{ + virtual static int i; // { dg-error "virtual" } +};
virtual1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr22003.C =================================================================== --- pr22003.C (nonexistent) +++ pr22003.C (revision 154) @@ -0,0 +1,25 @@ +/* PR rtl-optimization/22003 */ +/* { dg-do compile } */ +/* { dg-require-effective-target freorder } */ +/* { dg-options "-O2 -fno-exceptions -freorder-blocks-and-partition" } */ + +struct c1 +{ + virtual ~c1(); +}; +class c4; + +struct c2 +{ + virtual c4* func(); +}; + +struct c3 : c1, c2 +{ + c4* func(); +}; + +c4* c3::func() +{ +} +
pr22003.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: gc2.C =================================================================== --- gc2.C (nonexistent) +++ gc2.C (revision 154) @@ -0,0 +1,38 @@ +// PR c++/12316 +// Origin: Volker Reichelt + +// { dg-do compile } +// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } + +inline void FOO() {} + +template struct A +{ + A() {} + ~A() throw() {} +}; + +template struct B +{ + static void foo(); + static void bar() { foo(); } +}; + +struct C {}; + +template struct D : C +{ + D() {} + ~D() { B::bar(); } +}; + +template struct E : D +{ + static void baz() {} + E(A) { baz(); } +}; + +void BAR() +{ + new E(A()); +}
gc2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operator2.C =================================================================== --- operator2.C (nonexistent) +++ operator2.C (revision 154) @@ -0,0 +1,10 @@ +// PR c++/28852 +// { do-do compile } + +struct A +{ + operator int&(int); // { dg-error "void" } +}; + +A a; +int& i = a; // { dg-error "initialization" }
operator2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon4.C =================================================================== --- anon4.C (nonexistent) +++ anon4.C (revision 154) @@ -0,0 +1,8 @@ +// PR c++/27951 +// { dg-do compile } + +void foo() +{ + int i; // { dg-error "previously" } + union { int i; }; // { dg-error "redeclaration" } +}
anon4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr24623.C =================================================================== --- pr24623.C (nonexistent) +++ pr24623.C (revision 154) @@ -0,0 +1,69 @@ +/* This used to ICE due to a backend problem on s390. */ + +/* { dg-do compile } */ +/* { dg-options "-O1" } */ + +class ReferenceCounted +{ +public: + + virtual ~ ReferenceCounted () + { + } + void decrementRefCount () const + { + if (--const_cast < unsigned int &>(_ref_count) == 0) + { + delete this; + } + } + unsigned int _ref_count; +}; + +template < class T > class RefCountPointer +{ +public: + +RefCountPointer (T * p = 0):_p (p) + { + } + RefCountPointer & operator= (const RefCountPointer < T > &o) + { + if (_p != o._p) + { + if (_p != 0) + _p->decrementRefCount (); + } + } + ~RefCountPointer () + { + } + T *_p; +}; +class Item:public ReferenceCounted +{ +public: + + typedef RefCountPointer < const Item > Ptr; +}; +class AnyAtomicType:public Item +{ +}; +class StaticContext +{ +}; +class DynamicContext:public StaticContext +{ +}; +class SortableItem +{ + SortableItem (); + int m_bAscending:1; + DynamicContext *m_context; + AnyAtomicType::Ptr m_item; +}; +SortableItem::SortableItem () +{ + m_context = __null; + m_item = __null; +}
pr24623.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: struct-va_list.C =================================================================== --- struct-va_list.C (nonexistent) +++ struct-va_list.C (revision 154) @@ -0,0 +1,8 @@ +// { dg-do compile } +// PR target/13302 + +#include + +struct NumArgState{ + va_list ap; +};
struct-va_list.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: switch2.C =================================================================== --- switch2.C (nonexistent) +++ switch2.C (revision 154) @@ -0,0 +1,23 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 13 Oct 2005 + +// PR 22551:ICE +// Origin: Johnny Casey + +const int B = ~(~0u >> 1); + +#define b(x) (B + x) + + +int Foo (int error) +{ + switch (error) + { + case b (1): return 0; + case b (2): return 0; + case b (3): return 0; + case b (4): return 0; + case b (5): return 0; + } + return 0; +}
switch2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr29610.C =================================================================== --- pr29610.C (nonexistent) +++ pr29610.C (revision 154) @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -funswitch-loops" } */ + +struct __normal_iterator +{ + typedef int*const *_Iterator; + int*const * _M_current; + __normal_iterator(const _Iterator& __i) : _M_current(__i){} + const _Iterator& base() const {} +}; +struct string { ~string(){} }; +struct vector +{ + int** _M_finish; + __normal_iterator end() const { return __normal_iterator (_M_finish); } + int size() const { return end().base() - end().base(); } +}; +class Painter +{ + int redraw_window(void); + typedef int (Painter::* SliceWindowFunc)(void); + int for_each(vector&, SliceWindowFunc); + void tcl_command(void); +}; +inline int Painter::for_each(vector &layout, SliceWindowFunc func) +{ + for (unsigned int window = 0; window < layout.size();++window) + (this->*func)(); +} +int t; +int Painter::redraw_window(void) {t = 1;} +string t2(int); +vector *g(const string&); +void Painter::tcl_command(void) +{ + for_each(*g(t2(2)), &Painter::redraw_window); +} +
pr29610.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: abstract2.C =================================================================== --- abstract2.C (nonexistent) +++ abstract2.C (revision 154) @@ -0,0 +1,58 @@ +// { dg-do compile } +// Contributed by Gabriel Dos Reis +// PR c++/2204: Check for parameters of abstract type in function declarations. + +namespace N1 { + struct X; + + struct Y1 { + void g(X parm1); // { dg-error "abstract" } + void g(X parm2[2]); // { dg-error "abstract" } + void g(X (*parm3)[2]); // { dg-error "abstract" } + }; + + + template + struct Y2 { + void g(X parm4); // { dg-error "abstract" } + void g(X parm5[2]); // { dg-error "abstract" } + void g(X (*parm6)[2]); // { dg-error "abstract" } + }; + + struct X { // { dg-error "note" } + virtual void xfunc(void) = 0; // { dg-error "note" } + }; +} + +namespace N2 { + struct X1 { // { dg-error "note" } + virtual void xfunc(void) = 0; // { dg-error "note" } + void g(X1 parm7); // { dg-error "abstract" } + void g(X1 parm8[2]); // { dg-error "abstract" } + void g(X1 (*parm9)[2]); // { dg-error "abstract" } + }; + + template + struct X2 { // { dg-error "note" } + virtual void xfunc(void) = 0; // { dg-error "note" } + void g(X2 parm10); // { dg-error "abstract" } + void g(X2 parm11[2]); // { dg-error "abstract" } + void g(X2 (*parm12)[2]); // { dg-error "abstract" } + }; +} + +namespace N3 { + struct X { // { dg-error "note" "" } + virtual void xfunc(void) = 0; // { dg-error "note" } + }; + void g(X parm13); // { dg-error "abstract" } + void g(X parm14[2]); // { dg-error "abstract" } + void g(X (*parm15)[2]); // { dg-error "abstract" } + + template + void g(X parm16); // { dg-error "abstract" } + template + void g(X parm17[2]); // { dg-error "abstract" } + template + void g(X (*parm18)[2]); // { dg-error "abstract" } +}
abstract2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mult-stor1.C =================================================================== --- mult-stor1.C (nonexistent) +++ mult-stor1.C (revision 154) @@ -0,0 +1,8 @@ +// PR c++/20646 +// Origin: Dan Rosen +// { dg-do compile } + +struct A +{ + extern static int i; // { dg-error "conflicting specifiers" } +};
mult-stor1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: complex1.C =================================================================== --- complex1.C (nonexistent) +++ complex1.C (revision 154) @@ -0,0 +1,28 @@ +// PR middle-end/18882 +// Origin: Petr Mikulik +// Testcase by Wolfgang Bangerth + +// { dg-do run } +// { dg-options "" } + +extern "C" void abort (); + +struct C { + __complex__ long double c; +}; + +void foo() +{ + C x = {2+2i}; + + int n = 1; + C y = (n==1) ? x : (C){3+3i}; + if (__imag__ y.c != 2) + abort (); +} + +int main(void) +{ + foo (); + return 0; +}
complex1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opaque-1.C =================================================================== --- opaque-1.C (nonexistent) +++ opaque-1.C (revision 154) @@ -0,0 +1,29 @@ +/* { dg-do run { target powerpc-*-eabispe* } } */ + +#define __vector __attribute__((vector_size(8))) +typedef float __vector __ev64_fs__; + +__ev64_fs__ f; +__ev64_opaque__ o; + +int here = 0; + +void bar (__ev64_opaque__ x) +{ + here = 0; +} + +void bar (__ev64_fs__ x) +{ + here = 888; +} + +int main () +{ + f = o; + o = f; + bar (f); + if (here != 888) + return 1; + return 0; +}
opaque-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy1.C =================================================================== --- copy1.C (nonexistent) +++ copy1.C (revision 154) @@ -0,0 +1,83 @@ +// { dg-do run } + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 30 Nov 2001 + +// PR 87 + +int assign = 0; +int ctor = 0; +int assignC = 0; + +struct A { + int i; + + template + void operator=(const T&) const + { + assign = 1; + } + + A () : i (0) {} + + template A (const T &) + { + ctor = 1; + } +}; + +struct B : A +{ +}; + +struct C +{ + int i; + + C (int i_) :i (i_) {} + + template + void operator= (const C &) + { + assignC = 1; + } +}; + + +int main() +{ + const A a; + A b; + B c; + + b = a; + if (assign) + return 5; + + b.i = 100; + c.i = 200; + + a = b; + + if (!assign) + return 1; + if (a.i) + return 2; + + A e (b); + if (ctor) + return 3; + + A d (c); + if (!ctor) + return 4; + + C c0 (0); + C c1 (1); + + c0 = c1; + if (assignC) + return 5; + + return 0; +}
copy1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr27495.C =================================================================== --- pr27495.C (nonexistent) +++ pr27495.C (revision 154) @@ -0,0 +1,8 @@ + +// Test to make sure we do not ICE on this invalid program. + +struct A +{ + template void foo(); + void bar() { this.A::foo<0>(); } // { dg-error "" } +};
pr27495.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offsetof2.C =================================================================== --- offsetof2.C (nonexistent) +++ offsetof2.C (revision 154) @@ -0,0 +1,47 @@ +// { dg-do run } +// { dg-options -Wold-style-cast } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 22 Apr 2003 + +// DR273 POD can have an operator&, offsetof is still required to work + +#include + +struct POD1 +{ + int m; + + void *operator& () const {return 0;} // yes, still a pod! +}; + +struct POD2 +{ + int m; +}; + +void *operator& (POD2 const &) {return 0;} // ouch! + +struct POD3 +{ + int prefix; + + POD1 m; +}; + +struct POD4 +{ + int prefix; + + POD1 m; +}; + +int main () +{ + if (offsetof (POD3, m) != sizeof (int)) + return 1; + if (offsetof (POD4, m) != sizeof (int)) + return 2; + return 0; +} +
offsetof2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash-2.C =================================================================== --- crash-2.C (nonexistent) +++ crash-2.C (revision 154) @@ -0,0 +1,13 @@ +// { dg-do compile } +// { dg-options "-finline -finline-functions" } +// Contributed by Hans Buchmann +// PR c++/14033: ICE while inlining a function with incomplete parameter + +struct A; // { dg-error "forward declaration" } +void foo(A a) {} // { dg-error "incomplete" } +struct A {}; + +void bar(void) +{ + foo(A()); +}
crash-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bitfield2.C =================================================================== --- bitfield2.C (nonexistent) +++ bitfield2.C (revision 154) @@ -0,0 +1,9 @@ +// PR c++/28052 +// { dg-do compile } + +struct A +{ + double d : 2; // { dg-error "non-integral" } + A() {} + ~A() {} +};
bitfield2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: assign1.C =================================================================== --- assign1.C (nonexistent) +++ assign1.C (revision 154) @@ -0,0 +1,7 @@ +// PR c++/27716 +// { dg-do compile } + +int foo() +{ + return i ""= i; // { dg-error "not declared|string constant" } +}
assign1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const1.C =================================================================== --- const1.C (nonexistent) +++ const1.C (revision 154) @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 26 Dec 2001 + +// PR 335. Missed diagnostic + +struct Foo +{ + unsigned i; + void Modify(unsigned j) const; +}; + +void Foo::Modify(unsigned j) const +{ + Foo::i = j; // { dg-error "assignment of data-member" "" } +}
const1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stdarg3.C =================================================================== --- stdarg3.C (nonexistent) +++ stdarg3.C (revision 154) @@ -0,0 +1,16 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 8 Mar 2005 + +// PR 20375: ICE +// Origin: Joseph S. Myers +// { dg-options "-mlp64" { target "ia64-*-hpux*" } } + +union U +{ + void *m[7]; +}; + +struct C; + +void f(struct C *c, float f, union U, ...) +{ }
stdarg3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default4.C =================================================================== --- default4.C (nonexistent) +++ default4.C (revision 154) @@ -0,0 +1,29 @@ +// PR c++/15759 +// Origin: Lars Rune Nøstdal +// Testcase: Volker Reichelt + +// { dg-do run } + +extern "C" void abort(); + +int n = 0; + +int f() { return ++n; } + +int(&foo1)() = f; +int(*foo2)() = &f; +int(*foo3)() = f; + +int bar1(int i = foo1()) { return i; } +int bar2(int i = foo2()) { return i; } +int bar3(int i = foo3()) { return i; } +int bar4(int i = f()) { return i; } + +int main() +{ + if (bar1() != 1) abort(); + if (bar2() != 2) abort(); + if (bar3() != 3) abort(); + if (bar4() != 4) abort(); + return 0; +}
default4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pragma-re-1.C =================================================================== --- pragma-re-1.C (nonexistent) +++ pragma-re-1.C (revision 154) @@ -0,0 +1,20 @@ +/* { dg-do compile { target *-*-solaris* } } */ +/* { dg-final { scan-assembler "bar" } } */ +/* { dg-final { scan-assembler-not "foo" } } */ +/* { dg-final { scan-assembler "_Z3bazv" } } */ +/* { dg-final { scan-assembler-not "baq" } } */ + +#ifndef __PRAGMA_REDEFINE_EXTNAME +#error +#endif + +/* This one is expected to work. */ +#pragma redefine_extname foo bar +extern "C" int foo(void); +int (*p)(void) = foo; + +/* This one is expected not to work (redefine_extname + can only be applied to extern "C" names). */ +#pragma redefine_extname baz baq +extern int baz(void); +int (*q)(void) = baz;
pragma-re-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error2.C =================================================================== --- error2.C (nonexistent) +++ error2.C (revision 154) @@ -0,0 +1,14 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 26 Dec 2001 + +// PR 196. Misleading diagnostic + +namespace N +{ + class B { friend void operator>>(int, class B); }; + class N { friend void operator>>(int,class N); }; +} +void N::operator>>(int, N::B) // { dg-error "N::N::B|N::operator>>" } +{ }
error2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon-struct.C =================================================================== --- anon-struct.C (nonexistent) +++ anon-struct.C (revision 154) @@ -0,0 +1,9 @@ +// Contributed by Gabriel Dos Reis +// { dg-do compile } + +namespace N { } + +namespace M +{ + typedef struct { } N; +}
anon-struct.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error6.C =================================================================== --- error6.C (nonexistent) +++ error6.C (revision 154) @@ -0,0 +1,19 @@ +// { dg-do compile } +// Make sure we emit a decent error message when trying to mangle an +// expression not supported by the C++ ABI due to a defect. + +template +struct A {}; + +struct B +{ + static int foo(void); +}; + +template +A func(void); + +int main() +{ + func(); // { dg-error "sorry, unimplemented" } +}
error6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vararg-2.C =================================================================== --- vararg-2.C (nonexistent) +++ vararg-2.C (revision 154) @@ -0,0 +1,11 @@ +// { dg-do compile } +struct QString {}; +typedef __builtin_va_list __gnuc_va_list; +typedef __gnuc_va_list va_list; + QString & sprintf(QString &s,const QString &szFmt,...) + { + va_list list; + __builtin_va_start(list,((const char *)(&(szFmt)))); + __builtin_va_end(list); + return s; + }
vararg-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: incomplete2.C =================================================================== --- incomplete2.C (nonexistent) +++ incomplete2.C (revision 154) @@ -0,0 +1,14 @@ +// PR c++/19963 +// { dg-do compile } + +struct A; + +struct B +{ + A a : 1; // { dg-error "incomplete" } +}; + +struct S +{ + S : 1; // { dg-error "incomplete" } +};
incomplete2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon-union.C =================================================================== --- anon-union.C (nonexistent) +++ anon-union.C (revision 154) @@ -0,0 +1,22 @@ +// { dg-do compile } +// { dg-options -O2 } + +int foo (); +double bar (void) +{ + union + { + char a[8]; + double b; + }; + + a[0] = foo (); + a[1] = foo (); + a[2] = foo (); + a[3] = foo (); + a[4] = foo (); + a[5] = foo (); + a[6] = foo (); + a[7] = foo (); + return b; +}
anon-union.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: void2.C =================================================================== --- void2.C (nonexistent) +++ void2.C (revision 154) @@ -0,0 +1,5 @@ +// PR c++/27423 +// { dg-do compile } + +void foo(void = 0); // { dg-error "incomplete type|invalid use" } +void bar() { foo(); }
void2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem4.C =================================================================== --- ptrmem4.C (nonexistent) +++ ptrmem4.C (revision 154) @@ -0,0 +1,18 @@ +// Bug: This checks that the pointer-to-member-function type is not +// shared between differently-qualified pointer-to-method types. + +// { dg-do compile } +struct A +{ + void f () {} +}; + +void (A::*const cp)() = &A::f; + +int main () +{ + void (A::* p)(); + void (A::** ip)() = &p; + + *ip = &A::f; +}
ptrmem4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend2.C =================================================================== --- friend2.C (nonexistent) +++ friend2.C (revision 154) @@ -0,0 +1,23 @@ +// { dg-do run } +// Origin: Volker Reichelt + +// PR c++/12370 +// Wrong code because of the friend declaration + +template struct A +{ + T x; + A(T t) : x(t) {} + friend A foo (const A&); +}; + +A foo (const A& a) +{ + A res(a.x); + return res; +} + +int main() +{ + return foo(A(0)).x; +}
friend2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: linkage1.C =================================================================== --- linkage1.C (nonexistent) +++ linkage1.C (revision 154) @@ -0,0 +1,14 @@ +// { dg-do compile } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 9 Dec 2001 + +// PR 51 +// This example snippet is from the ISO C++ standard, sect 7.5 para 4: + +extern "C" typedef void FUNC_c(); + +class C { + public: + static FUNC_c* q; +};
linkage1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error13.C =================================================================== --- error13.C (nonexistent) +++ error13.C (revision 154) @@ -0,0 +1,10 @@ +//PR c++/28258 + +struct A +{ // { dg-error "" } + A(void x); // { dg-error "invalid use|incomplete type|candidates" } +}; + +struct B : A {}; // { dg-error "no matching function for call" } + +B b; // { dg-error "synthesized method" }
error13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ucnid-1.C =================================================================== --- ucnid-1.C (nonexistent) +++ ucnid-1.C (revision 154) @@ -0,0 +1,27 @@ +/* { dg-do run } */ +/* { dg-options "-fextended-identifiers" } */ +/* { dg-xfail-if "" { powerpc-ibm-aix* *-*-solaris2.* } { "*" } { "" } } */ +#include + +int \u00C0(void) { return 1; } +int \u00C1(void) { return 2; } +int \U000000C2(void) { return 3; } +int wh\u00ff(void) { return 4; } +int a\u00c4b\u0441\U000003b4e(void) { return 5; } + +int main (void) +{ + + if (\u00C0() != 1) + abort (); + if (\u00c1() != 2) + abort (); + if (\u00C2() != 3) + abort (); + if (wh\u00ff() != 4) + abort (); + if (a\u00c4b\u0441\U000003b4e() != 5) + abort (); + + return 0; +}
ucnid-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array2.C =================================================================== --- array2.C (nonexistent) +++ array2.C (revision 154) @@ -0,0 +1,6 @@ +// PR c++/25263 +// { dg-do compile } + +int x[1/0]; // { dg-warning "division by zero" } + // { dg-error "constant" "constant" { target *-*-* } 4 } +
array2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: constref2.C =================================================================== --- constref2.C (nonexistent) +++ constref2.C (revision 154) @@ -0,0 +1,16 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Matt Austern 12 Sep 2002 + +// Make sure that we can pass a cast-expression as an argument that's +// passed to a function template by const reference. + +template +void bar (const T&) +{ } + +void foo (int x) +{ + bar ((long) x); +}
constref2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual2.C =================================================================== --- virtual2.C (nonexistent) +++ virtual2.C (revision 154) @@ -0,0 +1,7 @@ +// PR c++/26071 +// { dg-do compile } + +struct A +{ + virtual static ~A(); // { dg-error "virtual" } +};
virtual2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static1.C =================================================================== --- static1.C (nonexistent) +++ static1.C (revision 154) @@ -0,0 +1,17 @@ +// PR c++/9574 +// Origin: fche@redhat.com and bangerth@dealii.org +// The new parser ICE on this test and then it could +// not find z in bar::bar(). + +// { dg-do compile } + +struct X { + void operator[](const int& __k); +}; +struct foo { + static X x; +}; +struct bar { + int z; + bar () { foo::x[z]; }; +};
static1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: gc3.C =================================================================== --- gc3.C (nonexistent) +++ gc3.C (revision 154) @@ -0,0 +1,8 @@ +// PR c++/21687 +// { dg-options "--param ggc-min-expand=0 --param ggc-min-heapsize=0" } + +template +void perform_test_trivial() { + struct check_union { void perform_test_trivial() {} }; +} +
gc3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl1.C =================================================================== --- redecl1.C (nonexistent) +++ redecl1.C (revision 154) @@ -0,0 +1,10 @@ +// PR c++/5857 +// This testcase failed because during duplicate_decls the type was promoted +// to int. + +// { dg-do compile } + +typedef char baz; +extern const char foo[]; +const baz foo[] = "xyz"; +const char bar[] = "abc";
redecl1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: big-struct.C =================================================================== --- big-struct.C (nonexistent) +++ big-struct.C (revision 154) @@ -0,0 +1,11 @@ +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-require-effective-target ilp32 } + +struct A +{ +}; + +struct B : public A +{ + char b[0x20000000]; +} e;
big-struct.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr30567.C =================================================================== --- pr30567.C (nonexistent) +++ pr30567.C (revision 154) @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O -finline-functions -fstrict-aliasing" } */ + +template +struct const_ref +{ + const T* begin; + const_ref(const T* b) : begin(b) {} +}; + +template +T sum(const_ref const& a) +{ + T result = 0; + for(unsigned i=0;i<1;i++) result += a.begin[i]; + return result; +} + +struct tiny_plain +{ + int elems[2]; + tiny_plain() { elems[0]=1; } +}; + +struct vec3 : tiny_plain {}; + +struct mat3 +{ + int type() const { return sum(const_ref(vec3().elems)) == 1; } +}; + +int main() { return mat3().type() ? 0 : 1; } +
pr30567.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opaque-2.C =================================================================== --- opaque-2.C (nonexistent) +++ opaque-2.C (revision 154) @@ -0,0 +1,18 @@ +/* { dg-do compile { target powerpc-*-eabi* } } */ +/* { dg-options "-mcpu=8540 -mabi=spe" } */ + +#define __vector __attribute__((vector_size(8))) +typedef float __vector __ev64_fs__; + +__ev64_fs__ f; +__ev64_opaque__ o; + +extern void bar (__ev64_opaque__); + +int main () +{ + f = o; + o = f; + bar (f); + return 0; +}
opaque-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy2.C =================================================================== --- copy2.C (nonexistent) +++ copy2.C (revision 154) @@ -0,0 +1,32 @@ +// { dg-do run } + +// Test that A's copy assignment method is called when B's instance +// member array of A is assigned. + +// Contributed by Brian Gaeke, public domain. +int status = 1; + +class A +{ +public: + int i; + A &operator =(const A &i) + { + status = 0; + } +}; + +class B +{ +public: + A arr[10]; +}; + +int main (int argc, char **argv) +{ + B b; + b.arr[0].i = 15; + B a; + a = b; // trigger copy assignment + return status; +}
copy2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offsetof3.C =================================================================== --- offsetof3.C (nonexistent) +++ offsetof3.C (revision 154) @@ -0,0 +1,16 @@ +/* Verify that offsetof warns if given a non-POD */ +/* Copyright (C) 2003 Free Software Foundation, Inc. */ +/* Contributed by Matt Austern 15 May 2003 */ +/* { dg-do compile } */ + +struct X +{ + X() : x(3), y(4) { } + int x, y; +}; + +typedef X* pX; +typedef __SIZE_TYPE__ size_t; + +size_t yoff = size_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */ +/* { dg-warning "macro was used incorrectly" "macro" { target *-*-* } 15 } */
offsetof3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash-3.C =================================================================== --- crash-3.C (nonexistent) +++ crash-3.C (revision 154) @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-options "-g" } +// Contributed by: +// and Niall Douglas +// PR c++/14246: ice in write_template_arg_literal while mangling boolean +// expressions. + +namespace N1 { + + template + struct A { + enum { Yes = (sizeof(T) == 1) }; + }; + + template + struct B { + void foo(void); + }; + + template struct B< !A::Yes >; + +} + + +namespace N2 { + + template struct A {}; + A a; + +} +
crash-3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ns1.C =================================================================== --- ns1.C (nonexistent) +++ ns1.C (revision 154) @@ -0,0 +1,13 @@ +// PR c++/14821 + +namespace A { + namespace B {} +} + +namespace A { + namespace Alias = ::A::B; +} + +namespace A { + namespace Alias = ::A::B; +}
ns1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: fold1.C =================================================================== --- fold1.C (nonexistent) +++ fold1.C (revision 154) @@ -0,0 +1,8 @@ +// PR middle-end/27384 +// { dg-do compile } + +struct A +{ + static const int i = i; // { dg-error "not declared" } + int x[i]; // { dg-error "integral constant-expression" } +};
fold1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default1.C =================================================================== --- default1.C (nonexistent) +++ default1.C (revision 154) @@ -0,0 +1,22 @@ +// PR c++/24103 +// ICE in simple_cst_equal +// Origin: Alexander Stepanov +// { dg-do compile } +// { dg-options "" } + +struct S +{ + int i; +}; + +struct A +{ + A(S = (S){0}); +}; + +struct B +{ + B(S = (S){0}); +}; + +B::B(S) {}
default1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion1.C =================================================================== --- conversion1.C (nonexistent) +++ conversion1.C (revision 154) @@ -0,0 +1,17 @@ +// PR C++/2213 +// Origin: philippeb@corel.com +// Copyright (C), 2002 Free Software Foundation +// Contributed by Gabriel Dos Reis + +// { dg-do compile } + +class QObject +{ +}; + +int main() +{ + long long m; + + (void (QObject::*)()) m; // { dg-error "invalid cast" "" } +}
conversion1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const2.C =================================================================== --- const2.C (nonexistent) +++ const2.C (revision 154) @@ -0,0 +1,22 @@ +// PR c++/3331: just because 'this' is readonly and bars[0].b is readonly +// doesn't mean that the result of the member reference is readonly. + +struct foo +{ + int a; + + struct bar + { int foo::* b ;}; + + static const bar bars[]; + + void bad () + { + this->*(bars[0].b) = 42; // { dg-bogus "read-only" "" } + } +}; + +const foo::bar foo::bars[] = { { &foo::a } }; + +int main () +{ }
const2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default5.C =================================================================== --- default5.C (nonexistent) +++ default5.C (revision 154) @@ -0,0 +1,47 @@ +// PR c++/28274 +// { dg-do "compile" } + +void f1(int, int, int, int, int = 0); +void f1(int, int, int, int = 0, int); +void f1(int, int, int = 0, int, int); +void f1(int = 0, int, int, int, int); // { dg-error "default" } + +void f2(int, int, int, int, int = 0) {} +void f2(int, int, int, int = 0, int); +void f2(int, int, int = 0, int, int); +void f2(int = 0, int, int, int, int); // { dg-error "default" } + +void f3(int, int, int, int, int = 0); +void f3(int, int, int, int = 0, int) {} +void f3(int, int, int = 0, int, int); +void f3(int = 0, int, int, int, int); // { dg-error "default" } + +void f4(int, int, int, int, int = 0); +void f4(int, int, int, int = 0, int); +void f4(int, int, int = 0, int, int) {} +void f4(int = 0, int, int, int, int); // { dg-error "default" } + +void f5(int, int, int, int, int = 0); +void f5(int, int, int, int = 0, int); +void f5(int, int, int = 0, int, int); +void f5(int = 0, int, int, int, int) {} // { dg-error "default" } + + +struct A +{ + void F1(int, int, int = 0); + void F2(int, int, int = 0); +}; + +void A::F1(int, int = 0, int) {} +void A::F2(int = 0, int, int) {} // { dg-error "default" } + + +template struct B +{ + void F1(int, int, int = 0); + void F2(int, int, int = 0); +}; + +template void B::F1(int, int = 0, int) {} +template void B::F2(int = 0, int, int) {} // { dg-error "default" }
default5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pragma-re-2.C =================================================================== --- pragma-re-2.C (nonexistent) +++ pragma-re-2.C (revision 154) @@ -0,0 +1,25 @@ +/* PR c++/14962 */ +/* Originator: */ + +/* { dg-do compile { target *-*-solaris* } } */ +/* { dg-final { scan-assembler "new_name" } } */ +/* { dg-final { scan-assembler-not "old_name" } } */ + +#ifndef __PRAGMA_REDEFINE_EXTNAME +#error +#endif + +extern "C" { + +struct old_name { int i; }; + +#pragma redefine_extname old_name new_name + +int old_name(void); + +} + +int foo(void) +{ + return old_name(); +}
pragma-re-2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error3.C =================================================================== --- error3.C (nonexistent) +++ error3.C (revision 154) @@ -0,0 +1,5 @@ +// Test for proper error message formatting; the throw() should go inside +// the parens, as below. + +void (*g() throw())(); // { dg-error "g\\(\\) throw" "" } +void (*g())(); // { dg-error "" "" }
error3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error7.C =================================================================== --- error7.C (nonexistent) +++ error7.C (revision 154) @@ -0,0 +1,12 @@ +// { dg-do compile } +// Origin: +// c++/8046: ICE on illegal code involving destructor being treated as bit-not +// expression + +class A; +namespace N {} + +void foo(void) +{ + N::~A(); // { dg-error "not a class-name" } +}
error7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: profile1.C =================================================================== --- profile1.C (nonexistent) +++ profile1.C (revision 154) @@ -0,0 +1,53 @@ +// PR 11767 +// { dg-do run } +// { dg-options "-fnon-call-exceptions -fprofile-arcs" } + +#include + +typedef unsigned long ACE_UINT32; +extern "C" void abort(); + +static ACE_UINT32 const msc_maxCurrencyID = 9999; + +class ResourceBalanceType2 +{ + public: + explicit ResourceBalanceType2( + ACE_UINT32 resourceBalanceTypeID, + ACE_UINT32 isoValue, + const std::string& rc_shortName, + const std::string& rc_symbol + ); + public: + const ACE_UINT32 mc_resBalTypeID; + const ACE_UINT32 mc_isoValue; + const std::string mc_shortName; + const std::string mc_symbol; +}; + +void f(){} + +ResourceBalanceType2::ResourceBalanceType2( + ACE_UINT32 resourceBalanceTypeID, + ACE_UINT32 isoValue, + const std::string& rc_shortName, + const std::string& rc_symbol) + : mc_resBalTypeID(resourceBalanceTypeID), + mc_isoValue(isoValue), + mc_shortName(rc_shortName), + mc_symbol(rc_symbol) +{ + bool isGreater = (mc_isoValue > msc_maxCurrencyID); + f(); + bool temp = mc_isoValue > msc_maxCurrencyID; + if (!isGreater) abort(); + if (!temp) abort(); +} + +int main (int argc, char * argv[]) +{ + ACE_UINT32 const mc_isoValue = 10000; + ResourceBalanceType2 rbResourceBalanceType2(3, mc_isoValue, "ATM", "M"); +} + +// { dg-final { cleanup-coverage-files } }
profile1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access1.C =================================================================== --- access1.C (nonexistent) +++ access1.C (revision 154) @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 12 Mar 2002 + +// PR c++/5659. Failed to notice default accessed changed + +class Foo; +struct Foo +{ + static int m; +}; + +class Outer { + private: + class Inner; + Inner *i; + public: + void pub(); +}; + +struct Outer::Inner { + Inner(int i); +}; + +void Outer::pub() { i = new Inner(Foo::m); }
access1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: incomplete3.C =================================================================== --- incomplete3.C (nonexistent) +++ incomplete3.C (revision 154) @@ -0,0 +1,9 @@ +//PR c++/28054 + +struct A; + +struct B +{ + friend A : 2; // { dg-error "incomplete type" } +}; +
incomplete3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem1.C =================================================================== --- ptrmem1.C (nonexistent) +++ ptrmem1.C (revision 154) @@ -0,0 +1,66 @@ +// { dg-do run } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 31 Dec 2001 + +// PR 4379. We created pointers to member references and pointers to +// member fields when we shouldn't have. + +int gs; +int gm; + +struct D { + D () :m (gm) {} + + int &m; + static int &s; + + int Foo (); +}; + +int &D::s = gs; + +template int f1(T x) +{ + return x != &gm; +} +template int f2(T x) +{ + return x != &gs; +} + +int D::Foo () +{ + int r; + + if (f1( &(D::m))) + return 3; + + if (f2( &D::s)) + return 1; + if (f2( &(D::s))) + return 2; + return 0; +} + +int Foo () +{ + if (f2( &D::s)) + return 4; + if (f2( &(D::s))) + return 5; + return 0; +} + +int main () +{ + D d; + int r = d.Foo (); + if (r) + return r; + r = Foo (); + if (r) + return r; + return 0; + +}
ptrmem1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem5.C =================================================================== --- ptrmem5.C (nonexistent) +++ ptrmem5.C (revision 154) @@ -0,0 +1,12 @@ +// PR 14123 + +struct a +{ + int x[8]; +}; + +int main() +{ + int a::*n[8]; + n = &a::x; // { dg-error "int \\(a::\\*\\)" } +}
ptrmem5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend3.C =================================================================== --- friend3.C (nonexistent) +++ friend3.C (revision 154) @@ -0,0 +1,13 @@ +// PR c++/22293 +// Origin: Volker Reichelt +// { dg-do compile } + +struct A +{ + friend ~A(); // { dg-error "qualified name" } +}; + +struct B +{ + friend ~A(); // { dg-error "qualified name" } +};
friend3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error10.C =================================================================== --- error10.C (nonexistent) +++ error10.C (revision 154) @@ -0,0 +1,15 @@ +// PR c++/21930 +// Test case by Volker Reichelt +// { dg-do compile } + +template struct A {}; + +template +void foo(const A &a) +{ -A(a); } // { dg-error "\\(\\(const A<0>\\*\\)a\\)" "" } + +void bar() +{ + foo(A<0>()); // { dg-error "instantiated from here" "" } +} +
error10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error14.C =================================================================== --- error14.C (nonexistent) +++ error14.C (revision 154) @@ -0,0 +1,7 @@ +//PR c++/26269 + +void foo() +{ + i; // { dg-error "not declared in this scope" } + int i; +}
error14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array3.C =================================================================== --- array3.C (nonexistent) +++ array3.C (revision 154) @@ -0,0 +1,14 @@ +// PR C++/28906: new on an array causes incomplete arrays to +// become complete with the wrong size. + +// the bounds of xvalue_store was being set to include want +// which was incorrect. + +// { dg-do compile } + +extern unsigned char xvalue_store[]; +bool reserve (int want) +{ + new unsigned char[want]; +} +unsigned char xvalue_store[257];
array3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: java1.C =================================================================== --- java1.C (nonexistent) +++ java1.C (revision 154) @@ -0,0 +1,22 @@ +// { dg-options "-w -ansi -pedantic" } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 23 Oct 2003 + +extern "Java" { + class One + { + ~One (); // { dg-error "cannot have a destructor" "" } + One (); + }; + + class Two {}; + + class Three : One {}; // { dg-error "cannot have an implicit" "" } + + class Four : Two {}; + + class Five : Two, Four {}; // { dg-error "cannot have multiple bases" "" } + + class Six : virtual Two {}; // { dg-error "cannot have virtual base" "" } +}
java1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: infloop-1.C =================================================================== --- infloop-1.C (nonexistent) +++ infloop-1.C (revision 154) @@ -0,0 +1,16 @@ +// PR 18300: This sends old compilers into an infinite loop on x86_64 +// Testcase and patch contributed by Zak Kipling + +struct base1 { }; +struct base2 { }; +struct base3 { }; + +struct derived : base1, base2, base3 { }; + +void foo(derived); + +int main() +{ + foo(derived()); +} +
infloop-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pragma-ep-1.C =================================================================== --- pragma-ep-1.C (nonexistent) +++ pragma-ep-1.C (revision 154) @@ -0,0 +1,27 @@ +/* { dg-do compile { target *-*-osf5* } } */ +/* { dg-final { scan-assembler "xyzzy_one" } } */ +/* { dg-final { scan-assembler "xyzzy_two" } } */ +/* { dg-final { scan-assembler "xyzzz_three" } } */ +/* { dg-final { scan-assembler "four" } } */ +/* { dg-final { scan-assembler-not "_four" } } */ + +#ifndef __PRAGMA_EXTERN_PREFIX +#error +#endif + +#pragma extern_prefix "xyzzy_" + +extern "C" int one(void); +extern "C" int two(void); + +#pragma extern_prefix "xyzzz_" + +extern "C" int three(void); + +#pragma extern_prefix "" + +extern "C" int four(void); + +void *p[] = { + (void *) one, (void *) two, (void *) three, (void *) four +};
pragma-ep-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static2.C =================================================================== --- static2.C (nonexistent) +++ static2.C (revision 154) @@ -0,0 +1,12 @@ +//PR c++/26573 + +void foo() +{ + struct A { static int i; }; // { dg-error "shall not have" } +} + +template +void bar() +{ + struct B { static int j; }; // { dg-error "shall not have" } +}
static2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new1.C =================================================================== --- new1.C (nonexistent) +++ new1.C (revision 154) @@ -0,0 +1,14 @@ +// PR c++/28267 +// { dg-do compile } + +struct A +{ + A(); + void* operator new(__SIZE_TYPE__, int = X); // { dg-error "not declared" } + void operator delete(void*, int); +}; + +void foo() +{ + new A; +}
new1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon2.C =================================================================== --- anon2.C (nonexistent) +++ anon2.C (revision 154) @@ -0,0 +1,22 @@ +// Test that we can have an unnamed struct inside an anonymous union. + +struct A +{ + union + { + struct { int i; } foo; + }; +}; + +static union +{ + struct { int i; } foo; +}; + +int main () +{ + union + { + struct { int i; } bar; + }; +}
anon2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl2.C =================================================================== --- redecl2.C (nonexistent) +++ redecl2.C (revision 154) @@ -0,0 +1,11 @@ +// PR c++/17816 +// We failed to report duplicate definitions of pure virtual ns. + +// { dg-do compile } + +struct S { + virtual int foo() = 0; +}; + +int S::foo() { return 0; } // { dg-error "defined here" } +int S::foo() { return 0; } // { dg-error "redefinition" }
redecl2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr28304.C =================================================================== --- pr28304.C (nonexistent) +++ pr28304.C (revision 154) @@ -0,0 +1,11 @@ + +// Test to make sure we do not ICE on this invalid program. + +struct A {}; + +template void A::foo(T) {} // { dg-error "" } + +void bar() +{ + A::foo(1); // { dg-error "no matching function for call" } +}
pr28304.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cv_func.C =================================================================== --- cv_func.C (nonexistent) +++ cv_func.C (revision 154) @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-options "-pedantic -pedantic-errors" } +typedef int FIC(int) const; +typedef int FI(int); + +FIC f; // { dg-error "qualified" } +// { dg-error "ignoring" "ignoring" { target *-*-* } 6 } +struct S { + FIC f; // OK + + const FI g; // { dg-error "qualifier" } + + int h(int) const; + +}; +FIC S::*pm = &S::f; +const FI S::*pm2 = &S::f; // { dg-error "qualifier" } +// { dg-error "cannot convert" "cannot convert" { target *-*-* } 17 } +const FIC S::*pm3 = &S::f; // { dg-error "qualifier" } + +int S::f(int) const +{ + return 17; +} + + +int foo(float) const // { dg-error "qualifier" } +{ + return 0; +} + +int bar(float) volatile; // { dg-error "qualifier" }
cv_func.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init1.C =================================================================== --- init1.C (nonexistent) +++ init1.C (revision 154) @@ -0,0 +1,28 @@ +// { dg-do compile } + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 13 Nov 2001 + +// Bug 3154 + +class A {}; + +struct B : A +{ + typedef A Parent; + + B () : Parent () {}; +}; + +class T +{ + typedef int Foo; + T () : Foo () {} // { dg-error "T::Foo' is not" "" } +}; + +struct S : B +{ + int Parent; + + S () :Parent (1) {} +};
init1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: i386-1.C =================================================================== --- i386-1.C (nonexistent) +++ i386-1.C (revision 154) @@ -0,0 +1,31 @@ +/* { dg-do run { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-march=pentium4" } */ +/* { dg-require-effective-target ilp32 } */ + +#include +#include +#include "../../gcc.dg/i386-cpuid.h" + +int main(int argc, char** argv) { + float a = 1.0f; + float b = 2.0f; + float c = 3.0f; + float r; + + unsigned long cpu_facilities; + + cpu_facilities = i386_cpuid (); + + if ((cpu_facilities & (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV)) + != (bit_MMX | bit_SSE | bit_SSE2 | bit_CMOV)) + /* If host has no vector support, pass. */ + return 0; + + __m128 v = _mm_set_ps(a, b, c, 0); + + v = (__m128)_mm_srli_si128((__m128i)v, 4); + _mm_store_ss(&r, v); + if (r != 3.0f) + abort (); + exit (0); +}
i386-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope1.C =================================================================== --- scope1.C (nonexistent) +++ scope1.C (revision 154) @@ -0,0 +1,14 @@ +// { dg-do compile } + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 30 Nov 2001 + +// PR 3381 + +namespace N { + template + class A { }; +} + +template class N::A; // this works (by itself) +template class ::N::A; // but this doesn't
scope1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opaque-3.C =================================================================== --- opaque-3.C (nonexistent) +++ opaque-3.C (revision 154) @@ -0,0 +1,11 @@ +/* { dg-do compile { target powerpc-*-eabi* } } */ +/* { dg-options "-mcpu=8540 -mabi=spe" } */ + +__ev64_opaque__ o; +#define v __attribute__((vector_size(8))) +v unsigned int *p; + +void m() +{ + o = __builtin_spe_evldd(p, 5); +}
opaque-3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nontype-1.C =================================================================== --- nontype-1.C (nonexistent) +++ nontype-1.C (revision 154) @@ -0,0 +1,7 @@ +template +bool asfun(Op f, + Op::first_argument_type a, // { dg-error "not a type" } + Op::second_argument_type b) // { dg-error "not a type" } +{ + return Op(a, b); +}
nontype-1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: classkey1.C =================================================================== --- classkey1.C (nonexistent) +++ classkey1.C (revision 154) @@ -0,0 +1,17 @@ +// { dg-do compile } + +// Copyright (C) 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 28 Feb 2002 + +// PR 775. Some mismatches which were broken. + +template struct A {}; +union A a; // { dg-error "'union' tag" "" } + +template <> union A {}; // { dg-error "'union' tag" "" } + +struct B {}; +union B b; // { dg-error "'union' tag" "" } + +union C {}; +class C c; // { dg-error "'class' tag" "" }
classkey1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offsetof4.C =================================================================== --- offsetof4.C (nonexistent) +++ offsetof4.C (revision 154) @@ -0,0 +1,16 @@ +/* Verify that -Wno-invalid-offsetof disables warning */ +/* Copyright (C) 2003 Free Software Foundation, Inc. */ +/* Contributed by Matt Austern 15 May 2003 */ +/* { dg-do compile } */ +/* { dg-options "-Wno-invalid-offsetof" } */ + +struct X +{ + X() : x(3), y(4) { } + int x, y; +}; + +typedef X* pX; +typedef __SIZE_TYPE__ size_t; + +size_t yoff = size_t(&(pX(0)->y));
offsetof4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash-4.C =================================================================== --- crash-4.C (nonexistent) +++ crash-4.C (revision 154) @@ -0,0 +1,26 @@ +// Copyright (C) 2005 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 14 Jun 2005 + +// PR 20678: ICE on error message +// Origin: Andrew Pinski pinskia@gcc.gnu.org + +// NOTE: This test assumes packed structure layout differs from unpacked +// structure layout. This isn't true, e.g., with the default +// arm-none-elf options. +// { dg-options "-mstructure-size-boundary=8" { target arm-*-* } } + +struct a +{ + int m; + a(const a&); +}; +struct b +{ // { dg-error "cannot bind packed field" "" { target { ! default_packed } } } + char c; + a aa __attribute__((packed)); // { dg-warning "attribute ignored" "" { target default_packed } } +}; +struct c +{ + b bb; + c(const b& __a): bb(__a) {} // { dg-error "synthesized" "" { target { ! default_packed } } } +};
crash-4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: stdarg1.C =================================================================== --- stdarg1.C (nonexistent) +++ stdarg1.C (revision 154) @@ -0,0 +1,26 @@ +// Test stdarg function with anonymous argument +// { dg-do run } + +#include + +extern "C" void abort (void); + +void baz (va_list list) +{ + if (va_arg (list, long) != 3) + abort (); +} + +void foo (long p1, long, long p2, ...) +{ + va_list list; + va_start (list, p2); + baz (list); + va_end (list); +} + +int main () +{ + foo (0, 1, 2, (long)3); + return 0; +}
stdarg1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default2.C =================================================================== --- default2.C (nonexistent) +++ default2.C (revision 154) @@ -0,0 +1,9 @@ +// PR c++/16829 +// { dg-do "compile" } + +template void foo(T, int = 0, int) {} // { dg-error "default" } + +void bar() +{ + foo(0); +}
default2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default6.C =================================================================== --- default6.C (nonexistent) +++ default6.C (revision 154) @@ -0,0 +1,18 @@ +// PR c++/30108 + +class BaseRobot { + typedef void (BaseRobot::*PseudoState)(void); + typedef PseudoState STATE; + STATE initial (); + int ready (); + STATE stpOtherTask (); + STATE commonEventProcessing (STATE pIdleTarget=(STATE)&BaseRobot::ready); +}; +BaseRobot::STATE BaseRobot::initial () +{ + return commonEventProcessing (); +} +BaseRobot::STATE BaseRobot::stpOtherTask () +{ + return commonEventProcessing (); +}
default6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error4.C =================================================================== --- error4.C (nonexistent) +++ error4.C (revision 154) @@ -0,0 +1,15 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 21 Mar 2003 + +// PR 9898. Confusing error message + +struct Wrapper {}; + +void Foo(int const &); // { dg-error "in passing" "" } + +void Baz () +{ + Foo (Wrapper ()); // { dg-error "Wrapper" "" } +}
error4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error8.C =================================================================== --- error8.C (nonexistent) +++ error8.C (revision 154) @@ -0,0 +1,22 @@ +// { dg-do compile } +// Contributed by: Michael Elizabeth Chastain +// +// PR c++/13927: Wrong error message for redeclartion of type from union + +void foo(void) +{ + union { int alpha; int beta; }; // { dg-error "previous declaration" } + double alpha; // { dg-error "conflicting declaration" } +} + +// This checks both the templated version, and the position of the diagnostic +// (which is currently wrong). +template +void tfoo(void) +{ + union { + int alpha; // { dg-error "" "" { xfail *-*-* } } + int beta; + }; // { dg-bogus "" "misplaced position of the declaration" { xfail *-*-* } } + double alpha; // { dg-error "" "" } +}
error8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access2.C =================================================================== --- access2.C (nonexistent) +++ access2.C (revision 154) @@ -0,0 +1,35 @@ +// { dg-do compile } +// Origin: Dirk Mueller + +// PR c++/2739 +// Access to base class private static member. + +class Base { +private: + static int fooprivate; +protected: + static int fooprotected; +public: + static int foopublic; +}; + +class Derived : public Base { +public: + void test(); +}; + +int Base::fooprivate=42; // { dg-error "private" } +int Base::fooprotected=42; +int Base::foopublic=42; + +void Derived::test() { + if ( fooprivate ); // { dg-error "context" } + if ( fooprotected ); + if ( foopublic ); +} + +int main() +{ + Derived d; + d.test(); +}
access2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr28432.C =================================================================== --- pr28432.C (nonexistent) +++ pr28432.C (revision 154) @@ -0,0 +1,7 @@ + +// Test to make sure we do not ICE on this invalid program. + +// { dg-options "" } + +struct A {}; +void A::foo(); // { dg-error "member function declared in class|outside of class is not definition" }
pr28432.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr22358.C =================================================================== --- pr22358.C (nonexistent) +++ pr22358.C (revision 154) @@ -0,0 +1,8 @@ +/* { dg-do compile } */ + +struct a +{ + virtual ~a(); +}; +struct b : virtual a { }; +b a11;
pr22358.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth1.C =================================================================== --- synth1.C (nonexistent) +++ synth1.C (revision 154) @@ -0,0 +1,31 @@ +// Copyright (C) 2004 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 17 Dec 2004 + +// PR 18975: Rejects legal +// Origin: Wolfgang Roehrl + +struct PTR +{ + PTR (); + PTR (PTR&); + PTR& operator= (PTR&); + +private: + PTR (const PTR&); + PTR& operator= (const PTR&); +}; + + +struct XYZ +{ + XYZ (PTR& p) : ptr(p) {} + + mutable PTR ptr; +}; + + +XYZ f1 (); + + +XYZ f2 (void) { return f1(); } +void f3 (XYZ& dst, const XYZ& src) { dst = src; }
synth1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning1.C =================================================================== --- warning1.C (nonexistent) +++ warning1.C (revision 154) @@ -0,0 +1,18 @@ +// { dg-do compile } + +// PR c++/7804 +// Floating point formatting in error and warning messages + +extern "C" int printf(const char *, ...); + +struct S +{ + static const float inf = 1.0f / 0.0f; // { dg-warning "1.0|float|initialization" } + static const float nan = 0.0f / 0.0f; // { dg-warning "0.0|float|initialization" } +}; + +int main() +{ + printf("%f\n%f\n", S::inf, S::nan); + return 0; +}
warning1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem2.C =================================================================== --- ptrmem2.C (nonexistent) +++ ptrmem2.C (revision 154) @@ -0,0 +1,36 @@ +// { dg-do compile } + +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 31 Dec 2001 + +// PR 4379. We created pointers to member references and pointers to +// member fields when we shouldn't have. + +struct D { + + int &m; // { dg-error "invalid use of non-static data member" "" } + static int &s; + + int Foo (); +}; + +template int f1(T x); +template int f2(T x); + +int D::Foo () +{ + f1( &D::m); // { dg-error "cannot create pointer to ref" "" } + f1( &(D::m)); // ok + f2( &D::s); // ok + f2( &(D::s)); // ok + return 0; +} + +int Foo () +{ + f1( &D::m); // { dg-error "cannot create pointer to ref" "" } + f1( &(D::m)); // { dg-error "from this location" "" } + f2( &D::s); // ok + f2( &(D::s)); // ok + return 0; +}
ptrmem2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: semicolon.C =================================================================== --- semicolon.C (nonexistent) +++ semicolon.C (revision 154) @@ -0,0 +1,9 @@ +// PR c++/18368 +// Origin: Chris Lattner +// { dg-do compile } + +struct A +{ + struct B { int i; } + void foo(); // { dg-error "two or more|return type" } +}; // { dg-error "semicolon is missing" "" { target *-*-* } 8 }
semicolon.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem6.C =================================================================== --- ptrmem6.C (nonexistent) +++ ptrmem6.C (revision 154) @@ -0,0 +1,10 @@ +// PR c++/19666 +// Origin: Volker Reichelt +// { dg-do compile } + +struct A { int i; }; + +int foo (A *p) +{ + return &p->i - &(p->*&A::i); +}
ptrmem6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: error11.C =================================================================== --- error11.C (nonexistent) +++ error11.C (revision 154) @@ -0,0 +1,17 @@ +/* { dg-options "-O1" } */ +struct A +{ + ERROR; /* { dg-error "ERROR" } */ + ~A(); +}; + +struct B +{ + virtual ~B(); +}; + +struct C : B, A {}; + +struct D : C {}; + +D d;
error11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend4.C =================================================================== --- friend4.C (nonexistent) +++ friend4.C (revision 154) @@ -0,0 +1,8 @@ +// Origin: Volker Reichelt +// Misleading diagnostic + +struct A +{ + friend void A::foo(); // { dg-error "implicitly friends" } + friend A::~A(); // { dg-error "implicitly friends" } +};
friend4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mmintrin.C =================================================================== --- mmintrin.C (nonexistent) +++ mmintrin.C (revision 154) @@ -0,0 +1,4 @@ +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-msse" } + +#include
mmintrin.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.