typeck.c (convert_arguments): Don't arbitrarily choose the first of a set of overload...
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 3 Sep 1997 08:26:52 +0000 (08:26 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 3 Sep 1997 08:26:52 +0000 (04:26 -0400)
        * typeck.c (convert_arguments): Don't arbitrarily choose the first
        of a set of overloaded functions.

        * lex.c (real_yylex): Don't elide __FUNCTION__.

From-SVN: r15055

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/lex.c
gcc/cp/pt.c
gcc/cp/typeck.c

index cef8c96dc7c707e75de1fd44c90b70e3935ccb8a..66418eb7983792c31372f6c1dc58f77169752983 100644 (file)
@@ -1,5 +1,12 @@
+Wed Sep  3 00:02:53 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * typeck.c (convert_arguments): Don't arbitrarily choose the first
+       of a set of overloaded functions.
+
 Tue Sep  2 12:09:13 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
+       * lex.c (real_yylex): Don't elide __FUNCTION__.
+
        * method.c (build_overload_value): Add in_template parm.
        (build_overload_int): Likewise.
        (build_overload_identifier): Pass it.
index c6b28846db86c1d6c5bd6f1c5fe80332bd8494a0..f2fe0380a93dd64b2f24d471536a456fe67da562 100644 (file)
@@ -4455,9 +4455,9 @@ build_new_function_call (fn, args, obj)
          return error_mark_node;
        }
 
-      /* Pedantically, it is ill-formed to define a function that could
-        also be a template instantiation, but we won't implement that
-        until things settle down.  */
+      /* Pedantically, normal function declarations are never considered
+        to refer to template instantiations, but we won't implement that
+        until we implement full template instantiation syntax.  */
       if (templates && ! cand->template && ! DECL_INITIAL (cand->fn))
        add_maybe_template (cand->fn, templates);
 
index 58c79dfa6a9ceaa89ac41e0a73b5ceb44af46205..83ac1a7de5bd4eca0852a07e051611b39d6af5d0 100644 (file)
@@ -3310,30 +3310,6 @@ real_yylex ()
 #endif
 
            yylval.ttype = tmp;
-
-           /* A user-invisible read-only initialized variable
-              should be replaced by its value.  We only handle strings
-              since that's the only case used in C (and C++).  */
-           /* Note we go right after the local value for the identifier
-              (e.g., __FUNCTION__ or __PRETTY_FUNCTION__).  We used to
-              call lookup_name, but that could result in an error about
-              ambiguities.  */
-           tmp = IDENTIFIER_LOCAL_VALUE (yylval.ttype);
-           if (tmp != NULL_TREE
-               && TREE_CODE (tmp) == VAR_DECL
-               && DECL_IGNORED_P (tmp)
-               && TREE_READONLY (tmp)
-               && DECL_INITIAL (tmp) != NULL_TREE
-               && TREE_CODE (DECL_INITIAL (tmp)) == STRING_CST)
-             {
-               tree stringval = DECL_INITIAL (tmp);
-             
-               /* Copy the string value so that we won't clobber anything
-                  if we put something in the TREE_CHAIN of this one.  */
-               yylval.ttype = build_string (TREE_STRING_LENGTH (stringval),
-                                            TREE_STRING_POINTER (stringval));
-               value = STRING;
-             }
          }
        if (value == NEW && ! global_bindings_p ())
          {
index 19a85e42cdffa1e8399a4cd73e9643ca79bd1099..4c79d948aa434a79247b3f052a8f693f45a3d3c6 100644 (file)
@@ -1300,7 +1300,7 @@ instantiate_class_template (type)
       TREE_VALUE (d) = xref_tag_from_type (TREE_VALUE (d), NULL_TREE, 1);
 
     d = tsubst (DECL_TEMPLATE_INJECT (template), &TREE_VEC_ELT (args, 0),
-                    TREE_VEC_LENGTH (args), NULL_TREE);
+               TREE_VEC_LENGTH (args), NULL_TREE);
 
     for (; d; d = TREE_CHAIN (d))
       {
index 6d2204ce81c16a1b3dd3b8a8e7a98fb61fde0538..2204c1f9c32bfd88010adc370c5252aa7b0044f0 100644 (file)
@@ -2800,18 +2800,12 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
          /* Strip the `&' from an overloaded FUNCTION_DECL.  */
          if (TREE_CODE (val) == ADDR_EXPR)
            val = TREE_OPERAND (val, 0);
-         if (TREE_CODE (val) == TREE_LIST
-             && TREE_CHAIN (val) == NULL_TREE
-             && TREE_TYPE (TREE_VALUE (val)) != NULL_TREE
-             && (TREE_TYPE (val) == unknown_type_node
-                 || DECL_CHAIN (TREE_VALUE (val)) == NULL_TREE))
-           /* Instantiates automatically.  */
-           val = TREE_VALUE (val);
+         if (really_overloaded_fn (val))
+           cp_error ("insufficient type information to resolve address of overloaded function `%D'",
+                     DECL_NAME (get_first_fn (val)));
          else
-           {
-             error ("insufficient type information in parameter list");
-             val = integer_zero_node;
-           }
+           error ("insufficient type information in parameter list");
+         val = integer_zero_node;
        }
       else if (TREE_CODE (val) == OFFSET_REF
            && TREE_CODE (TREE_TYPE (val)) == METHOD_TYPE)