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