aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-26 04:19:52 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-08-26 04:19:52 +0000
commitf18a14bcc121ed9812ecba53b3a458ed3d16953f (patch)
treec53bd3b828bb517a2846eccbd4ea66b2c560cc23
parentb06167fcc48be5a7b709cc031b5f6ab29c2c6d33 (diff)
downloadgcc-f18a14bcc121ed9812ecba53b3a458ed3d16953f.zip
gcc-f18a14bcc121ed9812ecba53b3a458ed3d16953f.tar.gz
gcc-f18a14bcc121ed9812ecba53b3a458ed3d16953f.tar.bz2
decl.c (grokdeclarator): Amend comment.
* decl.c (grokdeclarator): Amend comment. * except.c (expand_start_catch_block): Call push_template_decl for catch-block parameters. * method.c (synthesize_method): Build an empty compound statement for the body of a constructor. From-SVN: r28888
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/except.c2
-rw-r--r--gcc/cp/method.c8
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/tmpl4.C11
5 files changed, 30 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3395ca9..3fa07ec 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+1999-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (grokdeclarator): Amend comment.
+ * except.c (expand_start_catch_block): Call push_template_decl for
+ catch-block parameters.
+ * method.c (synthesize_method): Build an empty compound statement
+ for the body of a constructor.
+
1999-08-25 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (cp_build_qualified_type_real): If we're asking for the
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 3d16537..8d929ad 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11067,10 +11067,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (staticp)
{
- /* C++ allows static class members.
- All other work for this is done by grokfield.
- This VAR_DECL is built by build_lang_decl.
- All other VAR_DECLs are built by build_decl. */
+ /* C++ allows static class members. All other work
+ for this is done by grokfield. */
decl = build_lang_decl (VAR_DECL, declarator, type);
TREE_STATIC (decl) = 1;
/* In class context, 'static' means public access. */
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 3a6b9dd..4f8ad7b 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -524,6 +524,8 @@ expand_start_catch_block (declspecs, declarator)
{
decl = grokdeclarator (declarator, declspecs, CATCHPARM,
1, NULL_TREE);
+ if (processing_template_decl)
+ decl = push_template_decl (decl);
pushdecl (decl);
add_decl_stmt (decl);
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index ea76855..e39da7e 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -2386,7 +2386,13 @@ synthesize_method (fndecl)
if (arg_chain != void_list_node)
do_build_copy_constructor (fndecl);
else if (TYPE_NEEDS_CONSTRUCTING (current_class_type))
- setup_vtbl_ptr ();
+ {
+ tree compound_stmt;
+
+ setup_vtbl_ptr ();
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
+ finish_compound_stmt (/*has_no_scope=*/0, compound_stmt);
+ }
}
finish_function (lineno, 0, nested);
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/tmpl4.C b/gcc/testsuite/g++.old-deja/g++.eh/tmpl4.C
new file mode 100644
index 0000000..1f79981
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/tmpl4.C
@@ -0,0 +1,11 @@
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+template <class T> void test(){
+ try {
+ }
+ catch(int x){
+ }
+}
+
+template void test<int>();