OSDN Git Service

PR c++/43790
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Apr 2010 20:08:47 +0000 (20:08 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Apr 2010 20:08:47 +0000 (20:08 +0000)
* tree.c (cv_unqualified): Handle error_mark_node.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158801 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice1.C [new file with mode: 0644]

index f7456bf..68c6b49 100644 (file)
@@ -1,5 +1,8 @@
 2010-04-27  Jason Merrill  <jason@redhat.com>
 
 2010-04-27  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43790
+       * tree.c (cv_unqualified): Handle error_mark_node.
+
        PR c++/41468
        * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
        if we don't want errors.
        PR c++/41468
        * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
        if we don't want errors.
index 27ced53..0abc12c 100644 (file)
@@ -934,7 +934,12 @@ cp_build_qualified_type_real (tree type,
 tree
 cv_unqualified (tree type)
 {
 tree
 cv_unqualified (tree type)
 {
-  int quals = TYPE_QUALS (type);
+  int quals;
+
+  if (type == error_mark_node)
+    return type;
+
+  quals = TYPE_QUALS (type);
   quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
   return cp_build_qualified_type (type, quals);
 }
   quals &= ~(TYPE_QUAL_CONST|TYPE_QUAL_VOLATILE);
   return cp_build_qualified_type (type, quals);
 }
index c48c0fe..3a32098 100644 (file)
@@ -1,5 +1,7 @@
 2010-04-27  Jason Merrill  <jason@redhat.com>
 
 2010-04-27  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/cpp0x/lambda/lambda-ice1.C: New.
+
        PR c++/41468
        * g++.dg/template/sfinae17.C: New.
        * g++.dg/template/sfinae18.C: New.
        PR c++/41468
        * g++.dg/template/sfinae17.C: New.
        * g++.dg/template/sfinae18.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice1.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice1.C
new file mode 100644 (file)
index 0000000..1ea8f4d
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/43790
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+  int f();
+};
+
+int main()
+{
+  A a;
+  auto l = [] () { return a.f(); }; // { dg-error "not captured|return" }
+}