re PR c++/9898 (Template reference cast operator of template class)
cp: PR c++/9898 * error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'. (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. testsuite: PR c++/9898 * g++.dg/other/error4.C: New test. From-SVN: r64667
This commit is contained in:
parent
526278c97f
commit
f3146d75a9
@ -1,3 +1,9 @@
|
||||
2003-03-21 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/9898
|
||||
* error.c (dump_decl) [CONST_DECL]: Print '<enumerator>'.
|
||||
(dump_expr) [CONSTRUCTOR]: Print default ctor as a function call.
|
||||
|
||||
2003-03-20 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* cp/decl2.c (arg_assoc_class): Correct check for namespace-scope
|
||||
|
@ -971,7 +971,7 @@ dump_decl (tree t, int flags)
|
||||
else if (DECL_INITIAL (t))
|
||||
dump_expr (DECL_INITIAL (t), flags | TFF_EXPR_IN_PARENS);
|
||||
else
|
||||
print_identifier (scratch_buffer, "enumerator");
|
||||
print_identifier (scratch_buffer, "<enumerator>");
|
||||
break;
|
||||
|
||||
case USING_DECL:
|
||||
@ -1844,9 +1844,19 @@ dump_expr (tree t, int flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (TREE_TYPE (t) && !CONSTRUCTOR_ELTS (t))
|
||||
{
|
||||
dump_type (TREE_TYPE (t), 0);
|
||||
output_add_character (scratch_buffer, '(');
|
||||
output_add_character (scratch_buffer, ')');
|
||||
}
|
||||
else
|
||||
{
|
||||
output_add_character (scratch_buffer, '{');
|
||||
dump_expr_list (CONSTRUCTOR_ELTS (t), flags);
|
||||
output_add_character (scratch_buffer, '}');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case OFFSET_REF:
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-03-21 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
PR c++/9898
|
||||
* g++.dg/other/error4.C: New test.
|
||||
|
||||
2003-03-20 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* g++.dg/template/friend17.C: New test.
|
||||
|
15
gcc/testsuite/g++.dg/other/error4.C
Normal file
15
gcc/testsuite/g++.dg/other/error4.C
Normal file
@ -0,0 +1,15 @@
|
||||
// { dg-do compile }
|
||||
|
||||
// Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
// Contributed by Nathan Sidwell 21 Mar 2003 <nathan@codesourcery.com>
|
||||
|
||||
// PR 9898. Confusing error message
|
||||
|
||||
struct Wrapper {};
|
||||
|
||||
void Foo(int const &); // { dg-error "in passing" "" }
|
||||
|
||||
void Baz ()
|
||||
{
|
||||
Foo (Wrapper ()); // { dg-error "convert `Wrapper *\\(\\)' to" "" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user