* pt.c (do_auto_deduction): Don't try to deduce from a
type-dependent initializer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@188122
138bc75d-0d04-0410-961f-
82ee72b054a4
+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-05-31 Jason Merrill <jason@redhat.com>
PR c++/53500
tree decl;
int val;
- 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;
/* The name of the object being declared shall not appear in the
+2012-06-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/53484
+ * g++.dg/cpp0x/auto33.C: New.
+
2012-06-01 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/restrict-2.c: Revert previous change.
--- /dev/null
+// PR c++/53484
+// { dg-do compile { target c++11 } }
+
+template<class T,class U> struct ST;
+template<class T> struct ST<T,T> {};
+
+template <class T>
+void f(T x){
+ [&]{
+ auto y = x;
+ ST<decltype(y),int>();
+ }();
+}
+
+int main(){ f(0); }