]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/18803 (rejects access to operator() in template)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Sat, 17 Sep 2005 20:48:46 +0000 (20:48 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Sat, 17 Sep 2005 20:48:46 +0000 (20:48 +0000)
PR c++/18803
Revert:

2005-09-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
PR c++/18445
* class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
unknown_type as non matching.
* pt.c (build_non_dependent_expr): Do not build a
NON_DEPENDENT_EXPR for a VAR_DECL.

PR c++/18803
g++.dg/template/operator5.C: New test.

PR c++/18445
g++.dg/template/crash28.C: Remove.

From-SVN: r104374

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/crash28.C [deleted file]

index dcbd0f7cd0af09e5f1ad779f8d1e6a87ca2dfcf9..d6b2b593da72d3d58ab2d09ae3084996e891a696 100644 (file)
@@ -1,3 +1,15 @@
+2005-09-17  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/18803
+       Revert:
+
+       2005-09-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+       PR c++/18445
+       * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with
+       unknown_type as non matching.
+       * pt.c (build_non_dependent_expr): Do not build a
+       NON_DEPENDENT_EXPR for a VAR_DECL.
+
 2005-09-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        Backport:
index 8be36a04dcf981ed175c484f58a205c64b335527..09daf118a80f9e50b090185f851ff7b34761182d 100644 (file)
@@ -6030,15 +6030,6 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
   if (TREE_CODE (rhs) == BASELINK)
     rhs = BASELINK_FUNCTIONS (rhs);
 
-  /* If we are in a template, and have a NON_DEPENDENT_EXPR, we cannot
-     deduce any type information.  */
-  if (TREE_CODE (rhs) == NON_DEPENDENT_EXPR)
-    {
-      if (flags & tf_error)
-       error ("not enough type information");
-      return error_mark_node;
-    }
-
   /* We don't overwrite rhs if it is an overloaded function.
      Copying it would destroy the tree link.  */
   if (TREE_CODE (rhs) != OVERLOAD)
index 5fcbf300f51cdef59b6c82eb3472fa45d653b329..b877fbbe5eef6aa2e141600823ae7a37ff640233 100644 (file)
@@ -12245,9 +12245,6 @@ build_non_dependent_expr (tree expr)
       || TREE_CODE (inner_expr) == TEMPLATE_ID_EXPR
       || TREE_CODE (inner_expr) == OFFSET_REF)
     return expr;
-  /* There is no need to return a proxy for a variable.  */
-  if (TREE_CODE (expr) == VAR_DECL)
-    return expr;
   /* Preserve string constants; conversions from string constants to
      "char *" are allowed, even though normally a "const char *"
      cannot be used to initialize a "char *".  */
index 6bbc73d33277d65b608487a0bc594708b037742a..e7173433cdb8364ce7989adf4d5a738dafe4282d 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-17  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/18803
+       g++.dg/template/operator5.C: New test.
+
+       PR c++/18445
+       g++.dg/template/crash28.C: Remove.
+
 2005-09-08  Craig Rodrigues  <rodrigc@gcc.gnu.org>
 
        Backport from mainline:
diff --git a/gcc/testsuite/g++.dg/template/crash28.C b/gcc/testsuite/g++.dg/template/crash28.C
deleted file mode 100644 (file)
index 1ffa66f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// PR c++/18445
-
-struct a
-{
-  int what();
-};
-void g(void*);
-template<class T>
-void f()
-{
-  a ex;
-  g(ex.what); // { dg-error "not enough type information" }
-}