Commit e05de6f2 by Kelley Cook Committed by R. Kelley Cook

Remove DOS style trailing Carriage Returns

From-SVN: r84941
parent a57c6d6b
2004-07-19 Kelley Cook <kcook@gcc.gnu.org>
* except.c: Remove two spurious carriage returns.
2004-07-19 Mark Mitchell <mark@codesourcery.com>
PR c++/16623
......
......@@ -595,9 +595,9 @@ build_throw (tree exp)
fn = push_throw_library_fn (fn, tmp);
}
else if (really_overloaded_fn (fn))
{
{
error ("`%D' should never be overloaded", fn);
return error_mark_node;
return error_mark_node;
}
fn = OVL_CURRENT (fn);
exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE));
......
2004-07-19 Kelley Cook <kcook@gcc.gnu.org>
* g++.dg/lookup/java1.C, g++.dg/lookup/java2.C, g++.dg/other/crash-2.C,
g++.dg/parse/casting-operator2.C, g++.dg/parse/dtor3.C,
g++.dg/parse/typename6.C, g++.dg/template/dependent-expr4.C,
g++.dg/template/nontype3.C: Remove trailing CR from tests.
2004-07-18 Mark Mitchell <mark@codesourcery.com>
PR c++/16623
......
// { dg-do compile }
// { dg-options "-fdollars-in-identifiers" }
// Origin: Giovanni Bajo <giovannibajo at libero dot it>
// Make sure that Java special functions can be called correctly.
extern "Java"
{
typedef __java_int jint;
namespace java
{
namespace lang
{
class Class;
class Object;
class Throwable {};
class Foo;
}
}
}
typedef struct java::lang::Object* jobject;
typedef struct java::lang::Throwable* jthrowable;
typedef class java::lang::Class* jclass;
using java::lang::Foo;
class Foo : public java::lang::Throwable
{
public:
static ::java::lang::Class class$;
};
/*
* Step 1: no declarations. A declaration for _Jv_Throw is created.
*/
void Bar1(void)
{
Foo* f = new java::lang::Foo; // { dg-error "call to Java constructor" }
throw (f);
}
/*
* Step 2: constructor declaration
*/
extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
void Bar2(void)
{
Foo* f = new java::lang::Foo;
throw (f);
}
/*
* Step 3: overloads
*/
jobject _Jv_AllocObject (jclass, jint, float) __attribute__((__malloc__));
void _Jv_Throw (int, float) __attribute__ ((__noreturn__));
void Bar3(void)
{
Foo* f = new java::lang::Foo; // { dg-error "should never be overloaded" }
throw (f); // { dg-error "should never be overloaded" }
}
// { dg-do compile }
// { dg-options "-fdollars-in-identifiers" }
// Origin: Giovanni Bajo <giovannibajo at libero dot it>
// Make sure that Java special functions can be called correctly.
extern "Java"
{
typedef __java_int jint;
namespace java
{
namespace lang
{
class Class;
class Object;
class Throwable {};
class Foo;
}
}
}
typedef struct java::lang::Object* jobject;
typedef struct java::lang::Throwable* jthrowable;
typedef class java::lang::Class* jclass;
using java::lang::Foo;
class Foo : public java::lang::Throwable
{
public:
static ::java::lang::Class class$;
};
/*
* Step 1: no declarations. A declaration for _Jv_Throw is created.
*/
void Bar1(void)
{
Foo* f = new java::lang::Foo; // { dg-error "call to Java constructor" }
throw (f);
}
/*
* Step 2: constructor declaration
*/
extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
void Bar2(void)
{
Foo* f = new java::lang::Foo;
throw (f);
}
/*
* Step 3: overloads
*/
jobject _Jv_AllocObject (jclass, jint, float) __attribute__((__malloc__));
void _Jv_Throw (int, float) __attribute__ ((__noreturn__));
void Bar3(void)
{
Foo* f = new java::lang::Foo; // { dg-error "should never be overloaded" }
throw (f); // { dg-error "should never be overloaded" }
}
// { dg-do compile }
// { dg-options "-fdollars-in-identifiers" }
// Origin: Giovanni Bajo <giovannibajo at libero dot it>
// Make sure that Java special functions can be called correctly.
// (continue from java1.C)
extern "Java"
{
typedef __java_int jint;
namespace java
{
namespace lang
{
class Class;
class Object;
class Throwable {};
class Foo;
}
}
}
typedef struct java::lang::Object* jobject;
typedef struct java::lang::Throwable* jthrowable;
typedef class java::lang::Class* jclass;
using java::lang::Foo;
class Foo : public java::lang::Throwable
{
public:
static ::java::lang::Class class$;
};
/*
* Step 4: Manual declaration of _Jv_Throw
* This is the last case we need to test. In the other file we're testing
* the compiler is able to generate an artifical declaration for this
* function, so we need to test here if it works with a normal declaration.
*/
extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
void Bar4(void)
{
Foo* f = new java::lang::Foo;
throw (f);
}
// { dg-do compile }
// { dg-options "-fdollars-in-identifiers" }
// Origin: Giovanni Bajo <giovannibajo at libero dot it>
// Make sure that Java special functions can be called correctly.
// (continue from java1.C)
extern "Java"
{
typedef __java_int jint;
namespace java
{
namespace lang
{
class Class;
class Object;
class Throwable {};
class Foo;
}
}
}
typedef struct java::lang::Object* jobject;
typedef struct java::lang::Throwable* jthrowable;
typedef class java::lang::Class* jclass;
using java::lang::Foo;
class Foo : public java::lang::Throwable
{
public:
static ::java::lang::Class class$;
};
/*
* Step 4: Manual declaration of _Jv_Throw
* This is the last case we need to test. In the other file we're testing
* the compiler is able to generate an artifical declaration for this
* function, so we need to test here if it works with a normal declaration.
*/
extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
void Bar4(void)
{
Foo* f = new java::lang::Foo;
throw (f);
}
// { dg-do compile }
// { dg-options "-finline -finline-functions" }
// Contributed by Hans Buchmann <hans dot buchmann at fhso dot ch>
// 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());
}
// { dg-do compile }
// { dg-options "-finline -finline-functions" }
// Contributed by Hans Buchmann <hans dot buchmann at fhso dot ch>
// 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());
}
// { dg-do compile }
// Contributed by Martin Loewis <loewis at informatik dot hu-berlin dot de>
// PR c++/8856: Make sure template conversion operators are not parsed as
// template names.
struct K {};
template <bool> struct K2 {};
template <class T> struct A {
template <class U> operator U() { return U(); }
};
int main() {
A<double> a;
(void)a.operator int();
(void)a.operator double();
(void)a.operator K2<true>();
(void)a.A<double>::operator int();
(void)a.A<double>::operator double();
(void)a.A<double>::operator K2<true>();
(void)a.operator double<int>(); // { dg-error "not a template" }
(void)a.operator K<int>(); // { dg-error "not a template" }
(void)a.A<double>::operator double<int>(); // { dg-error "not a template" }
(void)a.A<double>::operator K<int>(); // { dg-error "not a template" }
}
// { dg-do compile }
// Contributed by Martin Loewis <loewis at informatik dot hu-berlin dot de>
// PR c++/8856: Make sure template conversion operators are not parsed as
// template names.
struct K {};
template <bool> struct K2 {};
template <class T> struct A {
template <class U> operator U() { return U(); }
};
int main() {
A<double> a;
(void)a.operator int();
(void)a.operator double();
(void)a.operator K2<true>();
(void)a.A<double>::operator int();
(void)a.A<double>::operator double();
(void)a.A<double>::operator K2<true>();
(void)a.operator double<int>(); // { dg-error "not a template" }
(void)a.operator K<int>(); // { dg-error "not a template" }
(void)a.A<double>::operator double<int>(); // { dg-error "not a template" }
(void)a.A<double>::operator K<int>(); // { dg-error "not a template" }
}
// { dg-do compile }
// Contributed by Wolfgang Bangerth <bangerth at dealii dot org>
// PR c++/12335: Make sure we don't ICE on the qualified-id form of a
// destructor call.
struct Y {
~Y() {} // { dg-bogus "note" "implemented DR272" { xfail *-*-* } }
};
struct X : Y {
~X() {} // { dg-bogus "note" "implemented DR272" { xfail *-*-* } }
void f() {
X::~X(); // { dg-bogus "" "implemented DR272" { xfail *-*-* } }
Y::~Y(); // { dg-bogus "" "implemented DR272" { xfail *-*-* } }
}
};
// { dg-do compile }
// Contributed by Wolfgang Bangerth <bangerth at dealii dot org>
// PR c++/12335: Make sure we don't ICE on the qualified-id form of a
// destructor call.
struct Y {
~Y() {} // { dg-bogus "note" "implemented DR272" { xfail *-*-* } }
};
struct X : Y {
~X() {} // { dg-bogus "note" "implemented DR272" { xfail *-*-* } }
void f() {
X::~X(); // { dg-bogus "" "implemented DR272" { xfail *-*-* } }
Y::~Y(); // { dg-bogus "" "implemented DR272" { xfail *-*-* } }
}
};
// { dg-do compile }
// Contributed by Matt Austern <austern at apple dot com>
// PR c++/13407: Gracefully handle keyword typename in base class specifier.
struct A { };
struct B { typedef A Type; };
template <typename T>
struct X :
public typename T::Type // { dg-error "not allowed in this context" }
{ };
X<B> x;
struct C :
public typename A // { dg-error "not allowed outside of templates" }
{ };
// { dg-do compile }
// Contributed by Matt Austern <austern at apple dot com>
// PR c++/13407: Gracefully handle keyword typename in base class specifier.
struct A { };
struct B { typedef A Type; };
template <typename T>
struct X :
public typename T::Type // { dg-error "not allowed in this context" }
{ };
X<B> x;
struct C :
public typename A // { dg-error "not allowed outside of templates" }
{ };
// { dg-do compile }
// Origin: jbrandmeyer at users dot sourceforge dot net
// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
// Or, more specifically OFFSETOF.
template <bool> struct S;
template <typename K> struct Y {
int x;
};
template <class T> struct Z {
S< (bool)(__builtin_offsetof (Y<T>*, x) == 0) >
s;
};
// { dg-do compile }
// Origin: jbrandmeyer at users dot sourceforge dot net
// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
// Or, more specifically OFFSETOF.
template <bool> struct S;
template <typename K> struct Y {
int x;
};
template <class T> struct Z {
S< (bool)(__builtin_offsetof (Y<T>*, x) == 0) >
s;
};
// { dg-do compile }
// Origin: <drow at gcc dot gnu dot org>,
// <giovannibajo at gcc dot gnu dot org>
// c++/13243: Template parameters of non integral or enumeration type can't be
// used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
// invalid too.
template <int T> class foo {};
template <int *T> class bar {};
template <int *PI>
void dep5(bar<PI> *);
template <int *PI>
void dep6(bar<PI+1> *); // { dg-error "" "integral or enumeration" }
template <int I>
void dep7(bar<I+1> *);
template <int *PI>
void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" }
template <int PI[1]>
void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" }
template <int PI[1]>
void dep9a(foo< sizeof(*PI) > *);
template <int PI[1]>
void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
template <int I>
void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
template <int I>
void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
// { dg-do compile }
// Origin: <drow at gcc dot gnu dot org>,
// <giovannibajo at gcc dot gnu dot org>
// c++/13243: Template parameters of non integral or enumeration type can't be
// used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
// invalid too.
template <int T> class foo {};
template <int *T> class bar {};
template <int *PI>
void dep5(bar<PI> *);
template <int *PI>
void dep6(bar<PI+1> *); // { dg-error "" "integral or enumeration" }
template <int I>
void dep7(bar<I+1> *);
template <int *PI>
void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" }
template <int PI[1]>
void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" }
template <int PI[1]>
void dep9a(foo< sizeof(*PI) > *);
template <int PI[1]>
void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
template <int I>
void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
template <int I>
void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment