aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-15 14:19:10 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-15 14:19:10 +0000
commitde4355dcd196cb80ac1f2c4e3ba67696a22e2484 (patch)
tree3c9cdd851e654dd096ba9dadc263e8e0fd0f80fb /gcc/testsuite/g++.dg/other
parent1da3f78aa8e9583ad941da07be0ad09431987964 (diff)
cp:
* class.c (add_method): Disallow destructor for java classes. * decl.c (xref_basetypes): Check java class inheritance. * decl2.c (check_java_method): Skip artificial params. testsuite: * g++.dg/other/java1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/other')
-rw-r--r--gcc/testsuite/g++.dg/other/java1.C22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/java1.C b/gcc/testsuite/g++.dg/other/java1.C
new file mode 100644
index 00000000000..38b5e0c3070
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/java1.C
@@ -0,0 +1,22 @@
+// { dg-options "-w -ansi -pedantic" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Oct 2003 <nathan@codesourcery.com>
+
+extern "Java" {
+ class One
+ {
+ ~One (); // { dg-error "cannot have a destructor" "" }
+ One ();
+ };
+
+ class Two {};
+
+ class Three : One {}; // { dg-error "cannot have an implicit" "" }
+
+ class Four : Two {};
+
+ class Five : Two, Four {}; // { dg-error "cannot have multiple bases" "" }
+
+ class Six : virtual Two {}; // { dg-error "cannot have virtual base" "" }
+}