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