re PR c++/43868 (ICE with -g)
PR c++/43868 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling... (pp_cxx_type_specifier_seq): ...here. From-SVN: r158947
This commit is contained in:
parent
8267740011
commit
5cb6410a27
@ -1,3 +1,9 @@
|
||||
2010-04-30 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/43868
|
||||
* cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
|
||||
(pp_cxx_type_specifier_seq): ...here.
|
||||
|
||||
2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
|
||||
|
@ -1170,16 +1170,6 @@ pp_cxx_decl_specifier_seq (cxx_pretty_printer *pp, tree t)
|
||||
pp_cxx_decl_specifier_seq (pp, TREE_TYPE (t));
|
||||
break;
|
||||
|
||||
case RECORD_TYPE:
|
||||
if (TYPE_PTRMEMFUNC_P (t))
|
||||
{
|
||||
tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t);
|
||||
pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm)));
|
||||
pp_cxx_whitespace (pp);
|
||||
pp_cxx_ptr_operator (pp, t);
|
||||
}
|
||||
break;
|
||||
|
||||
case FUNCTION_DECL:
|
||||
/* Constructors don't have return types. And conversion functions
|
||||
do not have a type-specifier in their return types. */
|
||||
@ -1275,6 +1265,17 @@ pp_cxx_type_specifier_seq (cxx_pretty_printer *pp, tree t)
|
||||
pp_cxx_right_paren (pp);
|
||||
break;
|
||||
|
||||
case RECORD_TYPE:
|
||||
if (TYPE_PTRMEMFUNC_P (t))
|
||||
{
|
||||
tree pfm = TYPE_PTRMEMFUNC_FN_TYPE (t);
|
||||
pp_cxx_decl_specifier_seq (pp, TREE_TYPE (TREE_TYPE (pfm)));
|
||||
pp_cxx_whitespace (pp);
|
||||
pp_cxx_ptr_operator (pp, t);
|
||||
break;
|
||||
}
|
||||
/* else fall through */
|
||||
|
||||
default:
|
||||
if (!(TREE_CODE (t) == FUNCTION_DECL && DECL_CONSTRUCTOR_P (t)))
|
||||
pp_c_specifier_qualifier_list (pp_c_base (pp), t);
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-04-30 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/43868
|
||||
* g++.dg/template/ptrmem21.C: New.
|
||||
|
||||
2010-04-30 Tobias Burnus Mburnus@net-b.de>
|
||||
|
||||
PR fortran/18918
|
||||
|
37
gcc/testsuite/g++.dg/template/ptrmem21.C
Normal file
37
gcc/testsuite/g++.dg/template/ptrmem21.C
Normal file
@ -0,0 +1,37 @@
|
||||
// PR c++/43868
|
||||
// { dg-options "-g" }
|
||||
|
||||
struct Foo
|
||||
{
|
||||
virtual void do_something() = 0;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Foo_impl;
|
||||
|
||||
template <typename R, typename O>
|
||||
struct Foo_impl<R (O::*)() const> : public Foo
|
||||
{
|
||||
struct Helper
|
||||
{
|
||||
typedef int Some_type;
|
||||
operator Some_type () const { return 0; }
|
||||
Helper( R (O::*)() const) {}
|
||||
};
|
||||
|
||||
void do_something() { Helper( 0); };
|
||||
};
|
||||
|
||||
void register_foo_internal( Foo*) {};
|
||||
|
||||
template <typename TT>
|
||||
void register_foo( TT) { register_foo_internal( new Foo_impl<TT>()); }
|
||||
|
||||
struct Bar
|
||||
{
|
||||
};
|
||||
|
||||
void setup()
|
||||
{
|
||||
register_foo( (int (Bar::*) () const) 0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user