]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/70540 (ICE on invalid code in cxx_incomplete_type_diagnostic, at cp/typeck2...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 21 Apr 2016 19:42:34 +0000 (19:42 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 21 Apr 2016 19:42:34 +0000 (19:42 +0000)
/cp
2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/70540
* semantics.c (process_outer_var_ref): Unconditionally return
error_mark_node when mark_used returns false.

/testsuite
2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/70540
* g++.dg/cpp0x/auto48.C: New.

From-SVN: r235348

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/auto48.C [new file with mode: 0644]

index 8efaa80b3444fb849b20f6e37977a2fc7a9b4018..5a9ad978d8341eefe6c9ab6d3e7a9cba0e959d39 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/70540
+       * semantics.c (process_outer_var_ref): Unconditionally return
+       error_mark_node when mark_used returns false.
+
 2016-04-21  Marek Polacek  <polacek@redhat.com>
 
        PR c++/70513
index 93b39ac9a77a84a2cba86103d79172960536d377..2365a732cbe179bc560b4efcf4359c83f427f87f 100644 (file)
@@ -3281,7 +3281,7 @@ process_outer_var_ref (tree decl, tsubst_flags_t complain)
   tree initializer = convert_from_reference (decl);
 
   /* Mark it as used now even if the use is ill-formed.  */
-  if (!mark_used (decl, complain) && !(complain & tf_error))
+  if (!mark_used (decl, complain))
     return error_mark_node;
 
   bool saw_generic_lambda = false;
index 52257e5bd8aa631f0cb9a8178d6231b45b42c9ee..0227f70243b8d721e32db45b9cee1913eebbba46 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/70540
+       * g++.dg/cpp0x/auto48.C: New.
+
 2016-04-21  Marek Polacek  <polacek@redhat.com>
 
        PR c++/70513
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto48.C b/gcc/testsuite/g++.dg/cpp0x/auto48.C
new file mode 100644 (file)
index 0000000..3e0b9ff
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/70540
+// { dg-do compile { target c++11 } }
+
+void
+foo ()
+{
+  auto f = [&] { return f; };  // { dg-error "before deduction" }
+}