URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/g++.dg/expr
- from Rev 154 to Rev 816
- ↔ Reverse comparison
Rev 154 → Rev 816
/return1.C
0,0 → 1,9
// PR c++/18545 |
|
struct A; |
|
A foo() // { dg-error "" } |
{ |
A a; // { dg-error "" } |
return a; |
} |
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: comma1.C
===================================================================
--- comma1.C (nonexistent)
+++ comma1.C (revision 816)
@@ -0,0 +1,21 @@
+// { dg-do run }
+
+extern "C" void abort ();
+
+struct gtst
+{
+ unsigned char data[2];
+};
+
+static struct gtst s;
+
+int main(int argc, char *argv[])
+{
+ unsigned char * pc;
+ struct gtst * ps;
+ ps = &s;
+ pc = (ps->data[0]='A', ps->data);
+ if (&s.data[0] != pc)
+ abort();
+ return 0;
+}
comma1.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: lval1.C
===================================================================
--- lval1.C (nonexistent)
+++ lval1.C (revision 816)
@@ -0,0 +1,7 @@
+// Contributed by Matt Austern
+
+void f ()
+{
+ int n;
+ (char) n = 1; // { dg-error "" }
+}
lval1.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: pmf-1.C
===================================================================
--- pmf-1.C (nonexistent)
+++ pmf-1.C (revision 816)
@@ -0,0 +1,19 @@
+// C++ PR/2521
+// Copyright (C) 2002 Free Software Foundation
+// Contributed by Gabriel Dos Reis
+
+// { dg-do compile }
+
+struct A
+{
+ void f();
+ void foo(void (A::*)(int)); // { dg-error "candidate" "" }
+ template
+ void g(T);
+ void h()
+ {
+ void (A::*p)() = &A::f;
+ void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" }
+ foo(&g); // { dg-error "" "" }
+ }
+};
pmf-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: static_cast1.C
===================================================================
--- static_cast1.C (nonexistent)
+++ static_cast1.C (revision 816)
@@ -0,0 +1,5 @@
+void foo(int x)
+{
+ static_cast(x);
+}
+
static_cast1.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: static_cast3.C
===================================================================
--- static_cast3.C (nonexistent)
+++ static_cast3.C (revision 816)
@@ -0,0 +1,24 @@
+template struct static_abort {};
+
+template
+struct any
+{
+ const E& self() const { return static_cast(*this); }
+};
+
+struct range : public any
+{
+ range() {}
+
+ template
+ range(const U&)
+ {
+ typedef typename static_abort::ret t;
+ }
+};
+
+int main()
+{
+ const any& r = *new range();
+ r.self();
+}
static_cast3.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: static_cast5.C
===================================================================
--- static_cast5.C (nonexistent)
+++ static_cast5.C (revision 816)
@@ -0,0 +1,17 @@
+void ambig()
+{
+ struct A {};
+ struct B : A {};
+ struct C : A {};
+ struct D : B, C {};
+
+ D d;
+ A* ap = static_cast (&d);
+ D* db = static_cast (ap); // { dg-error "" }
+
+ D& dr1 = static_cast (*ap); // { dg-error "" }
+
+ A& ar = static_cast (d);
+ D& dr = static_cast (ar); // { dg-error "" }
+}
+
static_cast5.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: pr19355-1.C
===================================================================
--- pr19355-1.C (nonexistent)
+++ pr19355-1.C (revision 816)
@@ -0,0 +1,11 @@
+// PR c++/19355
+// { dg-do compile }
+
+typedef bool Boolean;
+extern Boolean is_nil ();
+void f(void)
+{
+ unsigned int ilen;
+ if(!((ilen > 0 ? !is_nil () : 1))) {}
+}
+
pr19355-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: dtor1.C
===================================================================
--- dtor1.C (nonexistent)
+++ dtor1.C (revision 816)
@@ -0,0 +1,7 @@
+class Foo; // { dg-error "" }
+
+void
+bar(void* p)
+{
+ static_cast(p)->~Foo(); // { dg-error "" }
+}
dtor1.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: dtor3.C
===================================================================
--- dtor3.C (nonexistent)
+++ dtor3.C (revision 816)
@@ -0,0 +1,10 @@
+struct B {
+ ~B();
+};
+struct D : public B {
+ ~D();
+};
+
+void f(D d) {
+ d.B::~B();
+}
dtor3.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: call1.C
===================================================================
--- call1.C (nonexistent)
+++ call1.C (revision 816)
@@ -0,0 +1,16 @@
+namespace NS_1 {
+ struct A {};
+ struct foo {};
+}
+
+namespace NS_2 {
+ template void foo(T);
+
+ template
+ void bar() {
+ NS_1::A a;
+ NS_2::foo(a);
+ }
+
+ template void bar();
+}
call1.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: call3.C
===================================================================
--- call3.C (nonexistent)
+++ call3.C (revision 816)
@@ -0,0 +1,12 @@
+// PR c++/26036
+// Origin:
+// { dg-do compile }
+
+struct A
+{
+ int i;
+};
+
+A foo(int); // { dg-error "too few arguments" }
+
+int j = foo().i; // { dg-error "at this point" }
call3.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 816)
@@ -0,0 +1,15 @@
+// C++ PR/10476
+// Origin: larsbj@gullik.net and bangerth@dealii.org
+
+
+struct X {
+ X();
+ X(const X& __str);
+};
+X const bar();
+void foo()
+{
+ X y;
+ (true ? y : bar());
+}
+
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: bitfield1.C
===================================================================
--- bitfield1.C (nonexistent)
+++ bitfield1.C (revision 816)
@@ -0,0 +1,12 @@
+// PR c++/27505
+
+struct s {
+ bool field:8;
+};
+
+void
+foo (struct s *p)
+{
+ if (!p->field)
+ ;
+}
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: cond2.C
===================================================================
--- cond2.C (nonexistent)
+++ cond2.C (revision 816)
@@ -0,0 +1,12 @@
+struct Term { };
+struct Boolean : Term {
+ explicit Boolean(bool);
+};
+struct IsZero : Term {
+ Term *eval();
+};
+Term*
+IsZero::eval()
+{
+ return true ? new Boolean(false) : this; // { dg-error "" }
+}
cond2.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: bitfield3.C
===================================================================
--- bitfield3.C (nonexistent)
+++ bitfield3.C (revision 816)
@@ -0,0 +1,12 @@
+// PR c++/30274
+
+struct S {
+ bool x : 4;
+};
+
+S s;
+
+void f() {
+ s.x--; // { dg-error "bool" }
+ --s.x; // { dg-error "bool" }
+}
bitfield3.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 816)
@@ -0,0 +1,30 @@
+// PR target/26141
+
+#include
+
+struct S
+{
+ double a;
+};
+
+void
+foo (int z, ...)
+{
+ struct S arg;
+ va_list ap;
+ arg = va_arg (ap, struct S);
+}
+
+
+struct T
+{
+ __complex__ float a;
+};
+
+void
+bar (int z, ...)
+{
+ struct T arg;
+ va_list ap;
+ arg = va_arg (ap, struct T);
+}
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: bitfield5.C
===================================================================
--- bitfield5.C (nonexistent)
+++ bitfield5.C (revision 816)
@@ -0,0 +1,17 @@
+// PR c++/30274
+// { dg-do run }
+
+struct S {
+ bool x : 4;
+};
+
+S s;
+
+int main() {
+ s.x++;
+ if (s.x != 1)
+ return 1;
+ ++s.x;
+ if (s.x != 1)
+ return 2;
+}
bitfield5.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: cond4.C
===================================================================
--- cond4.C (nonexistent)
+++ cond4.C (revision 816)
@@ -0,0 +1,16 @@
+// PR c++/13971
+
+struct QChar {
+ static const QChar null;
+};
+struct QCharRef {
+ operator QChar() const;
+};
+struct QString {
+ QCharRef operator[](int i);
+};
+
+QChar fillParagraph(QString s, int psi) {
+ return psi ? QChar::null : s[psi];
+}
+
cond4.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: for2.C
===================================================================
--- for2.C (nonexistent)
+++ for2.C (revision 816)
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// PR c++/17661
+// We used to try to create a temprary for the condition
+// expression in the for which was wrong.
+
+
+struct C
+{
+ C (const C &x);
+};
+C &f();
+void breakme (C j, bool k)
+{
+ for (;; k ? j : f()) ;
+}
for2.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: bitfield7.C
===================================================================
--- bitfield7.C (nonexistent)
+++ bitfield7.C (revision 816)
@@ -0,0 +1,8 @@
+// PR c++/31273
+
+enum E { e };
+struct S {
+ E v:5;
+};
+S s;
+int main() { if (!s.v) return 0; }
bitfield7.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: cond6.C
===================================================================
--- cond6.C (nonexistent)
+++ cond6.C (revision 816)
@@ -0,0 +1,24 @@
+// { dg-do "run" }
+
+extern "C" void abort ();
+
+struct B {
+ B() {}
+ B(const B& b) { abort (); }
+};
+
+struct D : public B {
+ D() {}
+ D(const D& d) : B() {}
+};
+
+D d;
+B b;
+
+D f() {
+ return d;
+}
+
+int main () {
+ b = (true ? f() : b);
+}
cond6.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: bitfield9.C
===================================================================
--- bitfield9.C (nonexistent)
+++ bitfield9.C (revision 816)
@@ -0,0 +1,25 @@
+// PR c++/32346
+// { dg-do run }
+
+extern "C" void abort();
+
+struct S {
+ long long i : 32;
+};
+
+void f(int i, int j) {
+ if (i != 0xabcdef01)
+ abort();
+ if (j != 0)
+ abort();
+}
+
+void g(S s) {
+ f(s.i, 0);
+}
+
+int main() {
+ S s;
+ s.i = 0xabcdef01;
+ g(s);
+}
bitfield9.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: cast1.C
===================================================================
--- cast1.C (nonexistent)
+++ cast1.C (revision 816)
@@ -0,0 +1,3 @@
+struct S; // { dg-error "forward" }
+
+void f(S* p) { ((S) (*p)); } // { dg-error "" }
cast1.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: cond8.C
===================================================================
--- cond8.C (nonexistent)
+++ cond8.C (revision 816)
@@ -0,0 +1,13 @@
+// PR c++/22434
+// { dg-options "" }
+
+struct A
+{
+ A(void*);
+ ~A();
+};
+
+void foo(const int i, bool b)
+{
+ b ? A(0) : i; // { dg-error "conversion|initializing" }
+}
cond8.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: anew2.C
===================================================================
--- anew2.C (nonexistent)
+++ anew2.C (revision 816)
@@ -0,0 +1,27 @@
+// { dg-do run }
+// PR 11228: array operator new, with zero-initialization and a variable sized array.
+// Regression test for PR
+// Author: Matt Austern
+
+
+#include
+#include
+#include
+
+double* allocate(int n)
+{
+ void *p;
+ p = malloc(n * sizeof (double));
+ memset (p, 0xff, n * sizeof(double));
+ return new (p) double[n]();
+}
+
+int main()
+{
+ const int n = 17;
+ double* p = allocate(n);
+ for (int i = 0; i < n; ++i)
+ if (p[i] != 0.0)
+ abort ();
+ exit (0);
+}
anew2.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: cast3.C
===================================================================
--- cast3.C (nonexistent)
+++ cast3.C (revision 816)
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+enum MyState
+{
+ QUIT = 0,
+ START,
+ STOP,
+ PAUSE
+};
+
+double GetDouble()
+{
+ return 1.0;
+}
+
+int main()
+{
+ MyState the_state;
+
+ the_state = (MyState)GetDouble(); // { dg-bogus "invalid cast" }
+ return 0;
+}
cast3.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: anew4.C
===================================================================
--- anew4.C (nonexistent)
+++ anew4.C (revision 816)
@@ -0,0 +1,45 @@
+// { dg-do run { xfail *-*-* } }
+// XFAILed until PR2123 is fixed
+// PR 11228: array operator new, with zero-initialization and a variable sized array.
+// Regression test for PR
+// Author: Matt Austern
+
+#include
+#include
+#include
+
+struct B
+{
+ B();
+ int n;
+};
+
+B::B()
+{
+ n = 137;
+}
+
+
+struct D : public B
+{
+ double x;
+};
+
+
+D* allocate(int n)
+{
+ void *p;
+ p = malloc(n * sizeof (D));
+ memset (p, 0xff, n * sizeof(D));
+ return new (p) D[n]();
+}
+
+int main()
+{
+ const int n = 17;
+ D* p = allocate(n);
+ for (int i = 0; i < n; ++i)
+ if (p[i].n != 137 || p[i].x != 0)
+ abort ();
+ exit (0);
+}
anew4.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: unary1.C
===================================================================
--- unary1.C (nonexistent)
+++ unary1.C (revision 816)
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// Unary plus (but not unary minus) can be applied to pointer types
+
+void *p;
+
+void f(void)
+{
+ -p; // { dg-error "wrong type argument" }
+ +p;
+}
+
+template
+void g(void)
+{
+ -p; // { dg-error "wrong type argument" }
+ +p;
+}
unary1.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 816)
@@ -0,0 +1,14 @@
+// PR 10202
+// { dg-do compile }
+// { dg-options -O0 }
+
+extern struct _smtp_account smtp_accounts[];
+typedef struct _smtp_account {
+ int flags;
+} Smtp_Account;
+
+void get_smtp_host_info ()
+{
+ if (smtp_accounts[0].flags & 0x01)
+ get_smtp_host_info();
+}
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: sizeof2.C
===================================================================
--- sizeof2.C (nonexistent)
+++ sizeof2.C (revision 816)
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// Contributed by Wolfgang Bangerth
+// PR c++/9259: Allow non-qualified member calls in sizeof expressions.
+
+template struct StaticAssert;
+template <> struct StaticAssert {};
+
+struct S
+{
+ static int check ();
+ static double check2 ();
+ static const int value = sizeof(check());
+ static const int value2 = sizeof(check2());
+};
+
+template
+struct T
+{
+ static int check ();
+ static double check2 ();
+ static const int value = sizeof(check());
+ static const int value2 = sizeof(check2());
+};
+
+StaticAssert<(S::value == sizeof(int))> s;
+StaticAssert<(S::value2 == sizeof(double))> s2;
+
+StaticAssert<(T::value == sizeof(int))> t;
+StaticAssert<(T::value2 == sizeof(double))> t2;
+
sizeof2.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: cast7.C
===================================================================
--- cast7.C (nonexistent)
+++ cast7.C (revision 816)
@@ -0,0 +1,13 @@
+// PR c++/27177
+
+struct X {};
+
+struct Y : virtual X {};
+struct Z : virtual X {};
+
+struct A : Y, Z {};
+
+struct B : A
+{
+ static const int i = sizeof((Z*)(B*)0);
+};
cast7.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: crash2.C
===================================================================
--- crash2.C (nonexistent)
+++ crash2.C (revision 816)
@@ -0,0 +1,14 @@
+// PR c++/14267
+
+class foo {
+public: static int& x;
+};
+int temp;
+int& foo::x=temp;
+
+int main() {
+ int x = 3;
+ &foo::x = x; // { dg-error "" }
+ return 0;
+}
+
crash2.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: member-of-incomplete-type-1.C
===================================================================
--- member-of-incomplete-type-1.C (nonexistent)
+++ member-of-incomplete-type-1.C (revision 816)
@@ -0,0 +1,12 @@
+// Copyright (C) 2002 Free Software Foundation
+// Origin: jmr@fulcrummicro.com
+// Contributed by Gabriel Dos Reis
+
+
+struct A;
+
+int main()
+{
+ A::g(); // { dg-error "incomplete" "" }
+}
+
member-of-incomplete-type-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: enum1.C
===================================================================
--- enum1.C (nonexistent)
+++ enum1.C (revision 816)
@@ -0,0 +1,10 @@
+// { dg-do run }
+
+extern "C" void abort();
+int main()
+{
+ enum { shelf = 4 } t = shelf;
+ if (!(t & shelf))
+ abort ();
+}
+
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: ptrmem1.C
===================================================================
--- ptrmem1.C (nonexistent)
+++ ptrmem1.C (revision 816)
@@ -0,0 +1,33 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 2 Aug 2003
+
+// PR 11766. ICE
+
+template
+struct normal_iterator
+{
+ normal_iterator(const T& __i);
+};
+
+
+template
+struct vector
+{
+ void end() const { normal_iterator (this->pt); }
+ void size() const { end(); }
+ _Tp* pt;
+};
+
+
+
+struct MuonTag {
+ typedef void (MuonTag::*Selector)();
+};
+
+void foo()
+{
+ vector _selectors;
+ _selectors.size();
+}
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 816)
@@ -0,0 +1,7 @@
+// PR c++/15696
+
+struct A {};
+
+typedef void (A::*ftype)();
+
+void foo() { A().*ftype(); } // { dg-error "" }
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: ptrmem7.C
===================================================================
--- ptrmem7.C (nonexistent)
+++ ptrmem7.C (revision 816)
@@ -0,0 +1,21 @@
+// PR c++/22545
+
+struct A {
+ int member;
+ A() : member(13) {}
+};
+
+A a;
+
+struct B {
+ operator A*() { return &a; }
+};
+
+B b;
+
+int A::* member_pntr = &A::member;
+
+int main()
+{
+ return b ->* member_pntr;
+}
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: volatile1.C
===================================================================
--- volatile1.C (nonexistent)
+++ volatile1.C (revision 816)
@@ -0,0 +1,9 @@
+// PR c++/23167
+
+struct dom
+{
+ static int tostr();
+ void eval_old() volatile{tostr();}
+ ~dom() throw();
+};
+
volatile1.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: lval2.C
===================================================================
--- lval2.C (nonexistent)
+++ lval2.C (revision 816)
@@ -0,0 +1,27 @@
+// PR c++/19199
+
+// { dg-do run }
+
+// We used to turn the COND_EXPR lvalue into a MIN_EXPR rvalue, and
+// then return a reference to a temporary in qMin.
+
+#include
+
+enum Foo { A, B };
+
+template T &qMin(T &a, T &b)
+{
+ return a < b ? a : b;
+}
+
+int main (int, char **)
+{
+ Foo f = A;
+ Foo g = B;
+ Foo &h = qMin(f, g);
+ assert (&h == &f || &h == &g);
+ const Foo &i = qMin((const Foo&)f, (const Foo&)g);
+ assert (&i == &f || &i == &g);
+ return 0;
+}
+
lval2.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: static_cast2.C
===================================================================
--- static_cast2.C (nonexistent)
+++ static_cast2.C (revision 816)
@@ -0,0 +1,7 @@
+struct B {};
+
+int main () {
+ B a;
+ (1 ? static_cast(a) :
+ *static_cast(&a));
+}
static_cast2.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: static_cast4.C
===================================================================
--- static_cast4.C (nonexistent)
+++ static_cast4.C (revision 816)
@@ -0,0 +1,11 @@
+class C {
+public:
+ explicit C(int) {}
+};
+
+int main()
+{
+ int i = 0;
+ static_cast(i);
+ return 0;
+}
static_cast4.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: static_cast6.C
===================================================================
--- static_cast6.C (nonexistent)
+++ static_cast6.C (revision 816)
@@ -0,0 +1,15 @@
+// PR c++/21853
+
+struct blah {
+ int a;
+};
+
+int main( int argc, char ** argv ) {
+ int blah::* ptdma = &blah::a;
+
+ const void *ptdmv = static_cast< void * >( &ptdma );
+
+ int blah::* const ptdmb = * static_cast< int blah::* const * >( ptdmv );
+
+ return 0;
+}
static_cast6.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: dtor2.C
===================================================================
--- dtor2.C (nonexistent)
+++ dtor2.C (revision 816)
@@ -0,0 +1,6 @@
+typedef const int I;
+int i;
+
+void f() {
+ i.I::~I();
+}
dtor2.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 816)
@@ -0,0 +1,28 @@
+// PR c++/14035
+// { dg-do run }
+
+extern "C" void abort();
+
+struct Blob {
+ int x, y;
+ Blob() { }
+ Blob(const Blob &b) { abort (); }
+};
+struct Blobby : public Blob { };
+
+struct Wooly {
+ operator const Blobby & ()
+ {
+ return myBlobby;
+ }
+ Blobby myBlobby;
+};
+
+void catcher(const Blob &blo)
+{ }
+
+int main()
+{
+ Wooly wooly;
+ catcher((const Blob &)wooly);
+}
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: dtor4.C
===================================================================
--- dtor4.C (nonexistent)
+++ dtor4.C (revision 816)
@@ -0,0 +1,10 @@
+typedef int C;
+typedef double D;
+
+void
+f ()
+{
+ C o;
+
+ o.D::~C (); // { dg-error "" }
+}
dtor4.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: call2.C
===================================================================
--- call2.C (nonexistent)
+++ call2.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 11 Sep 2003
+// Origin: Wolfgang Bangerth
+// PR c++/12184. ICE
+
+class C;
+class D;
+bool mm(D);
+
+void g(C& f) {
+ mm(f); // { dg-error "parameter" "" }
+}
call2.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: cond1.C
===================================================================
--- cond1.C (nonexistent)
+++ cond1.C (revision 816)
@@ -0,0 +1,28 @@
+// { dg-do run }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 17 Oct 2002
+
+// PR 7209. We didn't SAVE_EXPR in the right place
+
+char a[2][1][16]={
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
+ {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}};
+
+int f() {return 0;}
+
+char * Foo (int d)
+{
+ char *c1;
+
+ c1=a[d==0 ? 0 : 1][f()];
+
+ return c1;
+}
+
+int main ()
+{
+ if (Foo (0) != (void *)a)
+ return 1;
+ return 0;
+}
cond1.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 816)
@@ -0,0 +1,9 @@
+// PR c++/27979
+
+class Ast
+{
+ enum AstKind { };
+ const AstKind kind : 8;
+ void foo(AstKind k) { }
+ void bar(void) { foo(kind); }
+};
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: stdarg1.C
===================================================================
--- stdarg1.C (nonexistent)
+++ stdarg1.C (revision 816)
@@ -0,0 +1,13 @@
+// PR c++/23840
+
+#include
+struct S
+{
+ int f(int);
+};
+void f(int i, ...)
+{
+ va_list ap;
+ va_start (ap, i);
+ va_arg (ap, S).f(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: assign1.C
===================================================================
--- assign1.C (nonexistent)
+++ assign1.C (revision 816)
@@ -0,0 +1,34 @@
+// { dg-do run }
+
+// Contributed by Nathan Sidwell 15 Dec 2003
+// Origin: Tasso Karkanis
+// PR c++/13387. Clobbered tail padding of base
+
+inline void *operator new (__SIZE_TYPE__, void *ptr)
+{
+ return ptr;
+}
+
+struct Base {
+ Base() : i(0), c(0) {}
+ int i;
+ char c;
+};
+
+struct Sub : Base {
+ Sub () : d(0) {}
+ char d;
+};
+
+int main() {
+ Sub sub;
+ char base_alias[sizeof (Base)];
+ Base *base;
+
+ for (unsigned ix = sizeof base_alias; ix--;)
+ base_alias[ix] = 0x55;
+ base = new (&base_alias) Base ();
+
+ static_cast (sub) = *base;
+ return sub.d;
+}
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: cond3.C
===================================================================
--- cond3.C (nonexistent)
+++ cond3.C (revision 816)
@@ -0,0 +1,6 @@
+const int i = 7;
+const int j = 3;
+
+void f(bool b) {
+ &(b ? i : j);
+}
cond3.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: bitfield4.C
===================================================================
--- bitfield4.C (nonexistent)
+++ bitfield4.C (revision 816)
@@ -0,0 +1,19 @@
+// PR c++/30274
+// { dg-do link }
+
+struct S {
+ bool x : 4;
+};
+
+S s;
+
+template
+void f(T);
+
+template <>
+void f(bool) {}
+
+int main() {
+ f(s.x++);
+ f(++s.x);
+}
bitfield4.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: for1.C
===================================================================
--- for1.C (nonexistent)
+++ for1.C (revision 816)
@@ -0,0 +1,14 @@
+// PR c++/13663
+
+struct S {
+ void f();
+};
+
+void g(int);
+void g(double);
+
+void h () {
+ S s;
+ for (;;s.f); // { dg-error "" }
+ for (;;g); // { dg-error "" }
+}
for1.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: bitfield6.C
===================================================================
--- bitfield6.C (nonexistent)
+++ bitfield6.C (revision 816)
@@ -0,0 +1,11 @@
+// PR c++/30274
+
+struct S {
+ bool x : 4;
+};
+
+S s;
+
+void f() {
+ ++s.x = false;
+}
bitfield6.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: cond7.C
===================================================================
--- cond7.C (nonexistent)
+++ cond7.C (revision 816)
@@ -0,0 +1,12 @@
+// PR c++/19148
+
+struct QChar {
+ QChar (char c);
+ QChar (const QChar &);
+ unsigned short ucs;
+};
+
+void f(QChar *uc, unsigned short ch, QChar replacement)
+{
+ *uc++ = ((ch) ? QChar((1)) : replacement);
+}
cond7.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: bitfield8.C
===================================================================
--- bitfield8.C (nonexistent)
+++ bitfield8.C (revision 816)
@@ -0,0 +1,24 @@
+// PR c++/31513
+// { dg-do run }
+
+extern "C" void abort();
+
+struct tree_type {
+ unsigned int precision : 9;
+};
+
+void bork(unsigned int i) {
+ if (i != 7)
+ abort();
+}
+
+void foo(struct tree_type *t)
+{
+ bork(t->precision);
+}
+
+int main() {
+ tree_type t;
+ t.precision = 7;
+ foo(&t);
+}
bitfield8.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: anew1.C
===================================================================
--- anew1.C (nonexistent)
+++ anew1.C (revision 816)
@@ -0,0 +1,27 @@
+// { dg-do run }
+// PR 11228: array operator new, with zero-initialization and a variable sized array.
+// Regression test for PR
+// Author: Matt Austern
+
+
+#include
+#include
+#include
+
+int* allocate(int n)
+{
+ void *p;
+ p = malloc(n * sizeof (int));
+ memset (p, 0xff, n * sizeof(int));
+ return new (p) int[n]();
+}
+
+int main()
+{
+ const int n = 17;
+ int* p = allocate(n);
+ for (int i = 0; i < n; ++i)
+ if (p[i] != 0)
+ abort ();
+ exit (0);
+}
anew1.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: cast2.C
===================================================================
--- cast2.C (nonexistent)
+++ cast2.C (revision 816)
@@ -0,0 +1,5 @@
+void (*p)();
+
+void f() {
+ (void *)p; // { dg-error "" }
+}
cast2.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: cond9.C
===================================================================
--- cond9.C (nonexistent)
+++ cond9.C (revision 816)
@@ -0,0 +1,10 @@
+// PR c++/27666
+
+struct A { // { dg-error "A" }
+ A(int); // { dg-error "A" }
+};
+
+void foo(volatile A a) {
+ 1 ? a : 0; // { dg-error "match|temporary" }
+ 1 ? 0 : a; // { dg-error "match|temporary" }
+}
cond9.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: anew3.C
===================================================================
--- anew3.C (nonexistent)
+++ anew3.C (revision 816)
@@ -0,0 +1,32 @@
+// { dg-do run }
+// PR 11228: array operator new, with zero-initialization and a variable sized array.
+// Regression test for PR
+// Author: Matt Austern
+
+#include
+#include
+#include
+
+struct X
+{
+ int a;
+ double b;
+};
+
+X* allocate(int n)
+{
+ void *p;
+ p = malloc(n * sizeof (X));
+ memset (p, 0xff, n * sizeof(X));
+ return new (p) X[n]();
+}
+
+int main()
+{
+ const int n = 17;
+ X* p = allocate(n);
+ for (int i = 0; i < n; ++i)
+ if (p[i].a != 0 || p[i].b != 0.0)
+ abort ();
+ exit (0);
+}
anew3.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: cast4.C
===================================================================
--- cast4.C (nonexistent)
+++ cast4.C (revision 816)
@@ -0,0 +1,25 @@
+// { dg-do run }
+// PR c++/22132
+
+extern "C" void abort ();
+
+struct foo {
+ int a;
+ int b;
+};
+
+class Foobar : public foo {
+public:
+ Foobar() { a = 1; b = 2; };
+ virtual ~Foobar() {};
+};
+
+Foobar obj;
+const Foobar* objPtr = &obj;
+foo* f = (foo*)objPtr;
+
+int main () {
+ if (f->a != 1 || f->b != 2)
+ abort ();
+}
+
cast4.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: cast6.C
===================================================================
--- cast6.C (nonexistent)
+++ cast6.C (revision 816)
@@ -0,0 +1,6 @@
+void f(int &);
+void f(const int &);
+int main() {
+ volatile int x = 2;
+ f((int)x);
+}
cast6.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: sizeof1.C
===================================================================
--- sizeof1.C (nonexistent)
+++ sizeof1.C (revision 816)
@@ -0,0 +1,7 @@
+// PR c++/12989
+
+struct A
+{
+ int foo() { return sizeof(bar); } // { dg-error "" }
+ int bar();
+};
sizeof1.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: unary2.C
===================================================================
--- unary2.C (nonexistent)
+++ unary2.C (revision 816)
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Unary plus/minus are not lvalues.
+
+// In templates we require an instantiation to emit the diagnostic. This
+// is wrong and it is PR 18474.
+
+int n;
+
+void f(void)
+{
+ -n = 0; // { dg-error "lvalue" }
+ +n = 0; // { dg-error "lvalue" }
+}
+
+template
+void g(void)
+{
+ -n = 0; // { dg-error "lvalue" "" { xfail *-*-* } }
+ +n = 0; // { dg-error "lvalue" "" { xfail *-*-* } }
+}
unary2.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: sizeof3.C
===================================================================
--- sizeof3.C (nonexistent)
+++ sizeof3.C (revision 816)
@@ -0,0 +1,4 @@
+// PR c++/15337
+
+class CCC;
+int main() { sizeof(CCC); return 0; } // { dg-error ".*CCC.*" }
sizeof3.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: cast8.C
===================================================================
--- cast8.C (nonexistent)
+++ cast8.C (revision 816)
@@ -0,0 +1,11 @@
+// PR c++/29886
+
+struct A {
+ static int x[1];
+};
+
+void foo(int i)
+{
+ if (int(A::x[i])) {}
+}
+
cast8.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 816)
@@ -0,0 +1,16 @@
+// PR c++/15471
+// { dg-do run }
+
+struct myclass {
+ unsigned a;
+ union {
+ unsigned x;
+ };
+};
+
+int main () {
+ myclass foo;
+ unsigned myclass::* member = &myclass::x;
+ if (&(foo.*member) != &foo.x)
+ return 1;
+}
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: minmax.C
===================================================================
--- minmax.C (nonexistent)
+++ minmax.C (revision 816)
@@ -0,0 +1,14 @@
+// { dg-do compile }
+
+void f(void)
+{
+ int a, b;
+ (a >? b) = 1; // { dg-error "" }
+}
+
+
+void g(void)
+{
+ int a, b;
+ (a b) = 1; // { dg-error "" }
+}
minmax.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 816)
@@ -0,0 +1,12 @@
+// PR C++/21614
+// { dg-additional-sources "ptrmem6a.C" }
+// { dg-do run }
+
+extern struct Z *p;
+extern int (Z::*m) ();
+
+int main () {
+ if ((p->*m)() == 7)
+ return 0;
+ return 1;
+}
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: ptrmem6a.C
===================================================================
--- ptrmem6a.C (nonexistent)
+++ ptrmem6a.C (revision 816)
@@ -0,0 +1,9 @@
+struct Z {
+ int f();
+};
+
+int Z::f() { return 7; }
+
+struct Z z;
+int (Z::*m)() = &Z::f;
+struct Z*p = &z;
ptrmem6a.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