[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: PR 8702, problem with C++ parser
From:       Zack Weinberg <zack () codesourcery ! com>
Date:       2002-11-29 5:43:01
[Download RAW message or body]

Craig Rodrigues <rodrigc@attbi.com> writes: 

> Hi,
>
> I filed PR 8702, which indicates a problem with the C++ parser:
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&database=gcc&pr=8702

For what it's worth, this problem is reproducible with the new parser
(cp-parser-branch-2).  I get

test.cc:12: error: no `C2<X>::operator C1<Y>()' member function declared in 
   class `C2<X>'
test.cc:12: error: template definition of non-template 
   `C2<X>::operator C1<Y>()'

This is consistent with the hypothesis that the problem was caused by
Nathan's patch for PR c++/4361, 

> +2002-03-16  Nathan Sidwell  <nathan@codesourcery.com>
> +
> +       PR c++/4361
> +       * cp-tree.h (CLASSTYPE_METHOD_VEC): Document where templated
> +       conversion operators go.
> +       (struct lang_decl_flags): Add template_conv_p and unused
> +       bitfields.
> +       (DECL_TEMPLATE_CONV_FN_P): New macro.
> +       * call.c (build_user_type_conversion_1): Don't check second type
> +       conversion of overload set first.
> +       * class.c (add_method): Make sure templated conversion operators
> +       all end up on slot 2.
> +       * lex.c (do_identifier): A conversion operator token might be
> +       satisfied by a templated conversion operator.
> +       * mangle.c (struct globals) Add internal_mangling_p member.
> +       (write_template_param): Do internal mangling, if needed.
> +       (mangle_conv_op_name_for_type): Request internal mangling.
> +       * pt.c (check_explicit_specialization): Use
> +       CLASSTYPE_FIRST_CONVERSION_SLOT.
> +       (template_parm_this_level_p): New function.
> +       (push_template_decl_real): Determine DECL_TEMPLATE_CONV_FN_P.
> +       * search.c (lookup_fn_fields_1): Template conversions will be on
> +       the first slot.
> +       * typeck.c (build_component_ref): Preserve the type of an
> +       conversion operator name on the overload type.
> +       (build_x_function_call): Retrieve the conversion operator name.


because that patch does not touch the parser itself, only the template
resolution machinery.

cc:ing Nathan for comments.  I am not a C++ expert, but on a naive
reading the test case in PR 8702 looks well-formed.

zw
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic