PR c++/42399
* pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
From-SVN: r156635
+2010-02-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/42399
+ * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
+
2010-02-09 Jason Merrill <jason@redhat.com>
PR c++/42370
TREE_TYPE (r) = type;
CLASSTYPE_LAMBDA_EXPR (type) = r;
+ LAMBDA_EXPR_LOCATION (r)
+ = LAMBDA_EXPR_LOCATION (t);
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (r)
= LAMBDA_EXPR_DEFAULT_CAPTURE_MODE (t);
LAMBDA_EXPR_MUTABLE_P (r) = LAMBDA_EXPR_MUTABLE_P (t);
2010-02-09 Jason Merrill <jason@redhat.com>
+ PR c++/42399
+ * g++.dg/cpp0x/lambda/lambda-errloc2.C: New.
+
PR c++/42370
* g++.dg/cpp0x/lambda/lambda-warn2.C: New.
--- /dev/null
+// PR c++/42399
+// { dg-options "-std=c++0x" }
+
+struct A {
+ A();
+ A(const A&) = delete; // { dg-error "deleted function" }
+};
+
+template <class T>
+void f()
+{
+ T t;
+ [t] { return 0; }; // { dg-error "used here" }
+}
+
+int main()
+{
+ f<A>(); // { dg-message "instantiated" }
+}