aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-06-01 12:55:08 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-06-01 12:55:08 -0400
commitd37c775a73d38dd63ede24a26970d162c72fa963 (patch)
treeeccfa94f5010fea3a8689fc5794f2245c2a1eba6 /gcc/cp
parent676bd9a422b9641eeba45fc50837367ddfe82749 (diff)
downloadgcc-d37c775a73d38dd63ede24a26970d162c72fa963.zip
gcc-d37c775a73d38dd63ede24a26970d162c72fa963.tar.gz
gcc-d37c775a73d38dd63ede24a26970d162c72fa963.tar.bz2
re PR c++/53484 ([c++11] Wrong auto in lambdas in function templates)
PR c++/53484 * pt.c (do_auto_deduction): Don't try to deduce from a type-dependent initializer. From-SVN: r188116
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 95e698d..62f18fa 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/53484
+ * pt.c (do_auto_deduction): Don't try to deduce from a
+ type-dependent initializer.
+
2012-06-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/26155
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c55687b..b58dd13 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -20318,10 +20318,9 @@ do_auto_deduction (tree type, tree init, tree auto_node)
if (init == error_mark_node)
return error_mark_node;
- if (processing_template_decl
- && (TREE_TYPE (init) == NULL_TREE
- || BRACE_ENCLOSED_INITIALIZER_P (init)))
- /* Not enough information to try this yet. */
+ if (type_dependent_expression_p (init))
+ /* Defining a subset of type-dependent expressions that we can deduce
+ from ahead of time isn't worth the trouble. */
return type;
/* [dcl.spec.auto]: Obtain P from T by replacing the occurrences of auto