summaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-16 18:30:16 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-16 18:30:16 +0000
commitc0af458b43c9313c66a0a92a510220edf2c32d40 (patch)
treefe6bb32d28da75dc1021968451c83d5aba03ffe7 /gcc/cp/lex.c
parent82c2635008bbc6c3a07f24b89b3f0c6f23cd2098 (diff)
downloadgcc-c0af458b43c9313c66a0a92a510220edf2c32d40.tar.gz
cp:
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. testsuite: * g++.dg/template/conv1.C: New test. * g++.dg/template/conv2.C: New test. * g++.dg/template/conv3.C: New test. * g++.dg/template/conv4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50889 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 5990df946e1..7290a360db6 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -1199,6 +1199,9 @@ do_identifier (token, parsing, args)
{
if (current_template_parms)
return build_min_nt (LOOKUP_EXPR, token);
+ else if (IDENTIFIER_TYPENAME_P (token))
+ /* A templated conversion operator might exist. */
+ return token;
else if (IDENTIFIER_OPNAME_P (token))
{
if (token != ansi_opname (ERROR_MARK))