[PATCH] Fix PR c++/47172
Jason Merrill
jason@redhat.com
Thu Feb 10 15:44:00 GMT 2011
On 02/10/2011 10:26 AM, Dodji Seketeli wrote:
> Gabriel Dos Reis<gdr@integrable-solutions.net> writes:
>
>> Note that there is a strong disagreement/debate in the CWG about this.
>> So, putting it in the C++ front-end source code does not necssarily
>> help :-)
>
> OK. I just added the comment b/c it didn't seem obvious to me at first
> sight. I didn't mean to add to the controversy. I can remove it.
Just add a reference to issues 515 and 1005. For 4.6 we just want to
restore the previous behavior.
> + || (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
> + && current_class_ref
> + && type_dependent_expression_p (current_class_ref)))
I'm uncomfortable with checking DECL_NONSTATIC_MEMBER_FUNCTION_P before
we've established that fn is a FUNCTION_DECL. Let's check its TREE_CODE
first.
> /* Returns TRUE if the EXPRESSION is type-dependent, in the sense of
> - [temp.dep.expr]. */
> + [temp.dep.expr]. Note that an expression with no type is
> + considered dependent. */
Let's also note that other parts of the compiler arrange for an
expression with type-dependent subexpressions to have no type, so we
don't need to recurse in type_dependent_expression_p.
Jason
More information about the Gcc-patches
mailing list