From a9435373c0ca8136bacd2550dc696e6e24b6646a Mon Sep 17 00:00:00 2001 From: kcook Date: Tue, 20 Jul 2004 00:34:03 +0000 Subject: [PATCH] Remove DOS style trailing Carriage Returns git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84941 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 4 + gcc/cp/except.c | 4 +- gcc/testsuite/ChangeLog | 7 ++ gcc/testsuite/g++.dg/lookup/java1.C | 136 ++++++++++++------------ gcc/testsuite/g++.dg/lookup/java2.C | 94 ++++++++-------- gcc/testsuite/g++.dg/other/crash-2.C | 26 ++--- gcc/testsuite/g++.dg/parse/casting-operator2.C | 54 +++++----- gcc/testsuite/g++.dg/parse/dtor3.C | 32 +++--- gcc/testsuite/g++.dg/parse/typename6.C | 34 +++--- gcc/testsuite/g++.dg/template/dependent-expr4.C | 30 +++--- gcc/testsuite/g++.dg/template/nontype3.C | 74 ++++++------- 11 files changed, 253 insertions(+), 242 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4038747..84b4bdd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2004-07-19 Kelley Cook + + * except.c: Remove two spurious carriage returns. + 2004-07-19 Mark Mitchell PR c++/16623 diff --git a/gcc/cp/except.c b/gcc/cp/except.c index e978a54..91f9c87 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -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)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b5a322c..caadf49 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2004-07-19 Kelley Cook + + * 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 PR c++/16623 diff --git a/gcc/testsuite/g++.dg/lookup/java1.C b/gcc/testsuite/g++.dg/lookup/java1.C index 270910d..0d9b22e 100644 --- a/gcc/testsuite/g++.dg/lookup/java1.C +++ b/gcc/testsuite/g++.dg/lookup/java1.C @@ -1,68 +1,68 @@ -// { dg-do compile } -// { dg-options "-fdollars-in-identifiers" } -// Origin: Giovanni Bajo -// 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 +// 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" } +} diff --git a/gcc/testsuite/g++.dg/lookup/java2.C b/gcc/testsuite/g++.dg/lookup/java2.C index f3c81f4..26fd369 100644 --- a/gcc/testsuite/g++.dg/lookup/java2.C +++ b/gcc/testsuite/g++.dg/lookup/java2.C @@ -1,47 +1,47 @@ -// { dg-do compile } -// { dg-options "-fdollars-in-identifiers" } -// Origin: Giovanni Bajo -// 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 +// 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); +} diff --git a/gcc/testsuite/g++.dg/other/crash-2.C b/gcc/testsuite/g++.dg/other/crash-2.C index 3a19f3b..961a18a 100644 --- a/gcc/testsuite/g++.dg/other/crash-2.C +++ b/gcc/testsuite/g++.dg/other/crash-2.C @@ -1,13 +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()); -} +// { 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()); +} diff --git a/gcc/testsuite/g++.dg/parse/casting-operator2.C b/gcc/testsuite/g++.dg/parse/casting-operator2.C index 31f14b3..008fa62 100644 --- a/gcc/testsuite/g++.dg/parse/casting-operator2.C +++ b/gcc/testsuite/g++.dg/parse/casting-operator2.C @@ -1,27 +1,27 @@ -// { dg-do compile } -// Contributed by Martin Loewis -// PR c++/8856: Make sure template conversion operators are not parsed as -// template names. - -struct K {}; -template struct K2 {}; - -template struct A { - template operator U() { return U(); } -}; - -int main() { - A a; - - (void)a.operator int(); - (void)a.operator double(); - (void)a.operator K2(); - (void)a.A::operator int(); - (void)a.A::operator double(); - (void)a.A::operator K2(); - - (void)a.operator double(); // { dg-error "not a template" } - (void)a.operator K(); // { dg-error "not a template" } - (void)a.A::operator double(); // { dg-error "not a template" } - (void)a.A::operator K(); // { dg-error "not a template" } -} +// { dg-do compile } +// Contributed by Martin Loewis +// PR c++/8856: Make sure template conversion operators are not parsed as +// template names. + +struct K {}; +template struct K2 {}; + +template struct A { + template operator U() { return U(); } +}; + +int main() { + A a; + + (void)a.operator int(); + (void)a.operator double(); + (void)a.operator K2(); + (void)a.A::operator int(); + (void)a.A::operator double(); + (void)a.A::operator K2(); + + (void)a.operator double(); // { dg-error "not a template" } + (void)a.operator K(); // { dg-error "not a template" } + (void)a.A::operator double(); // { dg-error "not a template" } + (void)a.A::operator K(); // { dg-error "not a template" } +} diff --git a/gcc/testsuite/g++.dg/parse/dtor3.C b/gcc/testsuite/g++.dg/parse/dtor3.C index 000cb3c..3041ae4 100644 --- a/gcc/testsuite/g++.dg/parse/dtor3.C +++ b/gcc/testsuite/g++.dg/parse/dtor3.C @@ -1,16 +1,16 @@ -// { dg-do compile } -// Contributed by Wolfgang Bangerth -// 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 +// 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 *-*-* } } + } +}; diff --git a/gcc/testsuite/g++.dg/parse/typename6.C b/gcc/testsuite/g++.dg/parse/typename6.C index a0f5e39..dc458be 100644 --- a/gcc/testsuite/g++.dg/parse/typename6.C +++ b/gcc/testsuite/g++.dg/parse/typename6.C @@ -1,17 +1,17 @@ -// { dg-do compile } -// Contributed by Matt Austern -// PR c++/13407: Gracefully handle keyword typename in base class specifier. - -struct A { }; -struct B { typedef A Type; }; - -template -struct X : - public typename T::Type // { dg-error "not allowed in this context" } -{ }; - -X x; - -struct C : - public typename A // { dg-error "not allowed outside of templates" } -{ }; +// { dg-do compile } +// Contributed by Matt Austern +// PR c++/13407: Gracefully handle keyword typename in base class specifier. + +struct A { }; +struct B { typedef A Type; }; + +template +struct X : + public typename T::Type // { dg-error "not allowed in this context" } +{ }; + +X x; + +struct C : + public typename A // { dg-error "not allowed outside of templates" } +{ }; diff --git a/gcc/testsuite/g++.dg/template/dependent-expr4.C b/gcc/testsuite/g++.dg/template/dependent-expr4.C index 8e29654..b36c872 100644 --- a/gcc/testsuite/g++.dg/template/dependent-expr4.C +++ b/gcc/testsuite/g++.dg/template/dependent-expr4.C @@ -1,15 +1,15 @@ -// { 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 struct S; - -template struct Y { - int x; -}; - -template struct Z { - S< (bool)(__builtin_offsetof (Y*, 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 struct S; + +template struct Y { + int x; +}; + +template struct Z { + S< (bool)(__builtin_offsetof (Y*, x) == 0) > + s; +}; diff --git a/gcc/testsuite/g++.dg/template/nontype3.C b/gcc/testsuite/g++.dg/template/nontype3.C index 15a204f..5f24562 100644 --- a/gcc/testsuite/g++.dg/template/nontype3.C +++ b/gcc/testsuite/g++.dg/template/nontype3.C @@ -1,37 +1,37 @@ -// { dg-do compile } -// Origin: , -// -// 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 class foo {}; -template class bar {}; - -template -void dep5(bar *); - -template -void dep6(bar *); // { dg-error "" "integral or enumeration" } - -template -void dep7(bar *); - -template -void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" } - -template -void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" } - -template -void dep9a(foo< sizeof(*PI) > *); - -template -void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" } - -template -void dep11(foo< *&I > *); // { dg-error "" "constant-expression" } - -template -void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" } - +// { dg-do compile } +// Origin: , +// +// 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 class foo {}; +template class bar {}; + +template +void dep5(bar *); + +template +void dep6(bar *); // { dg-error "" "integral or enumeration" } + +template +void dep7(bar *); + +template +void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" } + +template +void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" } + +template +void dep9a(foo< sizeof(*PI) > *); + +template +void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" } + +template +void dep11(foo< *&I > *); // { dg-error "" "constant-expression" } + +template +void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" } + -- 2.7.4