aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-01-17 11:56:58 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-01-17 11:56:58 +0000
commite32fc4499f863fe0fa81767d11f40ad2f1ab1668 (patch)
tree74d7a86f509de000262ea8da0863b3d4b9560707 /gcc/cp
parentfc881de2825e37142436efcfd7537cc467f3430c (diff)
downloadgcc-e32fc4499f863fe0fa81767d11f40ad2f1ab1668.zip
gcc-e32fc4499f863fe0fa81767d11f40ad2f1ab1668.tar.gz
gcc-e32fc4499f863fe0fa81767d11f40ad2f1ab1668.tar.bz2
[PR c++/86610] lambda captures in templates
https://gcc.gnu.org/ml/gcc-patches/2019-01/msg00948.html PR c++/86610 * semantics.c (process_outer_var_ref): Only skip dependent types in templates. PR c++/86610 * g++.dg/cpp0x/pr86610.C: New. From-SVN: r268016
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/semantics.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 524fbd3..dec8d64 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-17 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/86610
+ * semantics.c (process_outer_var_ref): Only skip dependent types
+ in templates.
+
2019-01-17 Alexandre Oliva <aoliva@redhat.com>
PR c++/87768
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bc9d538..e654750 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3438,10 +3438,9 @@ process_outer_var_ref (tree decl, tsubst_flags_t complain, bool odr_use)
}
/* In a lambda within a template, wait until instantiation
- time to implicitly capture. */
+ time to implicitly capture a dependent type. */
if (context == containing_function
- && DECL_TEMPLATE_INFO (containing_function)
- && uses_template_parms (DECL_TI_ARGS (containing_function)))
+ && dependent_type_p (TREE_TYPE (decl)))
return decl;
if (lambda_expr && VAR_P (decl)