summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/inherit/template-as-base.C9
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 01a5f67c83b..42c2e9bf169 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-21 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ PR C++/3656
+ * semantics.c (finish_base_specifier): Handle erronous base
+ classes.
+
2002-03-22 Zack Weinberg <zack@codesourcery.com>
* error.c: Always use REAL_VALUE_TO_DECIMAL; don't test
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 14ecf05f9b5..29e49fa92c0 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -2026,7 +2026,12 @@ finish_base_specifier (access_specifier, base_class)
{
tree result;
- if (! is_aggr_type (base_class, 1))
+ if (base_class == error_mark_node)
+ {
+ error ("invalid base-class specification");
+ result = NULL_TREE;
+ }
+ else if (! is_aggr_type (base_class, 1))
result = NULL_TREE;
else
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a180bc9648d..866c4861980 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-03-22 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * g++.dg/inherit/template-as-base.C: New test.
+
2002-03-22 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/dwarf2-1.C: Move...
diff --git a/gcc/testsuite/g++.dg/inherit/template-as-base.C b/gcc/testsuite/g++.dg/inherit/template-as-base.C
new file mode 100644
index 00000000000..51f8c3ba158
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/template-as-base.C
@@ -0,0 +1,9 @@
+// Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
+// Distilled from PR C++/3656
+
+namespace N
+{
+ template<typename> struct X { };
+}
+
+struct A : N::X { };