diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y index c0138efc64d..cf3e8bfd16f 100644 --- a/gdb/cp-name-parser.y +++ b/gdb/cp-name-parser.y @@ -596,6 +596,7 @@ template_arg : typespec_2 | '&' '(' start ')' { $$ = state->fill_comp (DEMANGLE_COMPONENT_UNARY, state->make_operator ("&", 1), $3); } | exp + | function ; function_args : typespec_2 @@ -2062,6 +2063,9 @@ canonicalize_tests () should_be_the_same ("x::y::z<0b111>", "x::y::z<0D7>"); should_be_the_same ("x::y::z<0xff'ff>", "x::y::z<65535>"); + + should_be_the_same ("something", "something< void() >"); + should_be_the_same ("something", "something"); } #endif diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 536dbc40060..bd714ad32ce 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -2186,15 +2186,8 @@ test_cp_remove_params () CHECK_INCOMPL ("A::foo<(anonymous namespace)::B", "A::foo"); - /* Shouldn't this parse? Looks like a bug in - cp_demangled_name_to_comp. See PR c++/22411. */ -#if 0 CHECK ("A::foo::func(int)", "A::foo::func"); -#else - CHECK_INCOMPL ("A::foo::func(int)", - "A::foo"); -#endif CHECK_INCOMPL ("A::foo