diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/error3.C | 18 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6146404..c10022c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2001-01-10 Nathan Sidwell <nathan@codesourcery.com> + * error.c (dump_template_parameter): Use parm to determine how + to print default value. + +2001-01-10 Nathan Sidwell <nathan@codesourcery.com> + * class.c (duplicate_tag_error): Clear more flags. 2001-01-10 Nathan Sidwell <nathan@codesourcery.com> diff --git a/gcc/cp/error.c b/gcc/cp/error.c index ce11ae1..5ecdab7 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -336,7 +336,7 @@ dump_template_parameter (parm, flags) if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && a != NULL_TREE) { output_add_string (scratch_buffer, " = "); - if (TREE_CODE (a) == TYPE_DECL || TREE_CODE (a) == TEMPLATE_DECL) + if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL) dump_type (a, flags & ~TFF_CHASE_TYPEDEF); else dump_expr (a, flags | TFF_EXPR_IN_PARENS); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c4ae1e2..8c95265 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2001-01-10 Nathan Sidwell <nathan@codesourcery.com> + * g++.old_deja/g++.pt/error3.C: New test. + +2001-01-10 Nathan Sidwell <nathan@codesourcery.com> + * g++.old_deja/g++.other/crash39.C: New test. 2001-01-10 Nathan Sidwell <nathan@codesourcery.com> diff --git a/gcc/testsuite/g++.old-deja/g++.pt/error3.C b/gcc/testsuite/g++.old-deja/g++.pt/error3.C new file mode 100644 index 0000000..60a2ad5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/error3.C @@ -0,0 +1,18 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 10 Jan 2001 <nathan@codesourcery.com> + +// Bug 1606. We sorry'd issuing an error. + +struct A {}; +template <class T = A> class Tpl {}; + +struct B { + Tpl<int> s; +}; + +void foo (B *ptr) +{ + ptr->Tpl.t (); // ERROR - template as expression +} |