pt.c (value_dependent_expression_p): Tweak new cases to better match the wording...
authorJason Merrill <jason@redhat.com>
Wed, 18 May 2016 17:43:18 +0000 (13:43 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 18 May 2016 17:43:18 +0000 (13:43 -0400)
* pt.c (value_dependent_expression_p): Tweak new cases to better
match the wording in the standard.

From-SVN: r236421

gcc/cp/ChangeLog
gcc/cp/pt.c

index f459e50474baf6d04099092b1f2174075da8b627..81baa89a30d18b98f1c28d22d15615d12d9a38a0 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-18  Jason Merrill  <jason@redhat.com>
+
+       * pt.c (value_dependent_expression_p): Tweak new cases to better
+       match the wording in the standard.
+
 2016-05-18  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/69793
index 65bfd42a2e7c44f67d266b355ea352e0233d06a4..fde3091951747e7f9ed4c7195b41baa71ade989a 100644 (file)
@@ -22649,19 +22649,14 @@ value_dependent_expression_p (tree expression)
   switch (TREE_CODE (expression))
     {
     case BASELINK:
-      /* A member function of a dependent class has dependent template
-        arguments from its class.  */
-      if (dependent_type_p (BINFO_TYPE (BASELINK_BINFO (expression))))
-       return true;
-      return value_dependent_expression_p (BASELINK_FUNCTIONS (expression));
+      /* A dependent member function of the current instantiation.  */
+      return dependent_type_p (BINFO_TYPE (BASELINK_BINFO (expression)));
 
     case FUNCTION_DECL:
-      /* A function template specialization is value-dependent if it has any
-        dependent template arguments, since that means it cannot be
-        instantiated for constexpr evaluation.  */
-      if (DECL_LANG_SPECIFIC (expression)
-         && DECL_TEMPLATE_INFO (expression))
-       return any_dependent_template_arguments_p (DECL_TI_ARGS (expression));
+      /* A dependent member function of the current instantiation.  */
+      if (DECL_CLASS_SCOPE_P (expression)
+         && dependent_type_p (DECL_CONTEXT (expression)))
+       return true;
       break;
 
     case IDENTIFIER_NODE: