From-SVN: r20400
This commit is contained in:
Jason Merrill 1998-06-09 23:14:02 -04:00
parent 0202018521
commit 04be6a2297
14 changed files with 73 additions and 13 deletions

View File

@ -1,6 +0,0 @@
const void *cvp;
const void func1 ()
{
return *cvp; /* ERROR - returning a value from a void function */
}

View File

@ -1,6 +1,5 @@
// Build don't link:
// GROUPS passed operators
// excess errors test - XFAIL *-*-*
// (Message bugs/opr-del:4)
// From: jamshid@ses.com (Jamshid Afshar)
// Date: Fri, 25 Feb 94 18:44:01 CST

View File

@ -336,7 +336,7 @@ struct vertex {
vertex(): item(), fanout() // gets bogus error
{ };
vertex(const T& i): item(), fanout() // gets bogus error - XFAIL *-*-*
vertex(const T& i): item(), fanout() // gets bogus error
{ };
};
@ -458,7 +458,7 @@ void
Graph<T>::nextV1(Pix vx, Pix& x) const
{
vertex<T> *v = (vertex<T> *) vx;
return v->fanout.next(x); // ERROR - return from void method
return v->fanout.next(x);
}
template<class T>

View File

@ -0,0 +1,13 @@
// Build don't link:
struct foo {
operator char*() const;
};
void bar(foo a) {
delete a; // should be accepted - XFAIL *-*-*
delete[] a; // should be accepted - XFAIL *-*-*
char b[1];
delete b; // ERROR - expecting pointer type
delete[] b; // ERROR - expecting pointer type
}

View File

@ -0,0 +1,27 @@
// Objects must be destructed in decreasing cnt order
// Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
// execution test - XFAIL *-*-*
static int cnt;
class A {
int myCnt;
public:
A() : myCnt(cnt++) {}
~A() { if (--cnt != myCnt) abort(); }
};
void f() { static A a; /* a.myCnt == 1 */ }
class B {
int myCnt;
public:
B() : myCnt(cnt+1) { f(); ++cnt; }
~B() { if (--cnt != myCnt) abort(); }
};
static A a1; // a1.myCnt == 0
static B b1; // b1.myCnt == 2
static A a2; // a2.myCnt == 3
int main() {}

View File

@ -0,0 +1,20 @@
// Test for implicit typename
// Build don't link:
// Special g++ Options:
template <class T>
struct A {
protected:
typedef struct B { } B;
};
template <class T>
struct C { };
template <class T>
struct D : public A <C <T> > {
void f ()
{
B* new_entries = (B *) 0;
}
};

View File

@ -3,6 +3,7 @@
// cannot declare friend of enclosing class using its scope, works fine
// without scope or for definition of foo::bar::f
//
// excess errors test - XFAIL *-*-*
class foo
{

View File

@ -3,6 +3,7 @@
*/
/* (w) 4.9.97 by Kurt Garloff <K.Garloff@ping.de> */
// Special g++ Options:
// excess errors test - XFAIL *-*-*
#include <iostream.h>

View File

@ -13,7 +13,7 @@ private:
template <typename T>
foo<T>::foo() :v(), t() {}
template <typename T=float> // ERROR - default parm for member template
template <typename T=float> // ERROR - default parm for member template XFAIL *-*-*
foo<T>::foo(vector<int> v_) :v(v_), t() {}
foo<float> a;

View File

@ -1,3 +1,5 @@
// excess errors test - XFAIL *-*-*
#include <vector.h>
#include <algo.h>

View File

@ -1,4 +1,5 @@
// Build don't link:
// Build don't link:
// excess errors test - XFAIL *-*-*
// Here we declare ::S
typedef struct s1 *S;

View File

@ -1,6 +1,7 @@
// conversion ops should be treated as coming from the most derived class
// for overload resolution. See [over.match.funcs].
// Build don't link:
// excess errors test - XFAIL *-*-*
class X {
public:

View File

@ -1,5 +1,6 @@
//Build don't link:
// the template operator!= interferes. It should be in a namespace.
// excess errors test - XFAIL *-*-*
#include <utility>
@ -13,6 +14,6 @@ struct X {
void
f(X& v) {
if( v.t != V1 ) { // gets bogus error - address of bitfield
if( v.t != V1 ) { // complains about taking address of bitfield
}
}

View File

@ -1,5 +1,5 @@
// Another magic NULL problem.
// Special g++ Options:
// Special g++ Options: -w
#include <stddef.h>