public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paolo Carlini <paolo.carlini@oracle.com>
To: Jason Merrill <jason@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] PR 52487
Date: Tue, 20 Mar 2012 20:38:00 -0000	[thread overview]
Message-ID: <4F68E9F2.7070406@oracle.com> (raw)
In-Reply-To: <4F68E506.3050200@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

... this simple also passes testing.

Paolo.

////////////////////

[-- Attachment #2: CL_52487_2 --]
[-- Type: text/plain, Size: 274 bytes --]

/cp
2012-03-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/52487
	* class.c (check_field_decls): Call literal_type_p only
	on complete types.

/testsuite
2012-03-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/52487
	* g++.dg/cpp0x/lambda/lambda-ice7.C: New.

[-- Attachment #3: patch_52487_2 --]
[-- Type: text/plain, Size: 984 bytes --]

Index: testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C
===================================================================
--- testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C	(revision 0)
+++ testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C	(revision 0)
@@ -0,0 +1,9 @@
+// PR c++/52487
+// { dg-options "-std=c++0x" }
+
+struct A;         // { dg-error "forward declaration" }
+
+void foo(A& a)
+{
+  [=](){a;};      // { dg-error "invalid use of incomplete type" }
+}
Index: cp/class.c
===================================================================
--- cp/class.c	(revision 185588)
+++ cp/class.c	(working copy)
@@ -3150,7 +3150,7 @@ check_field_decls (tree t, tree *access_decls,
 
       /* If at least one non-static data member is non-literal, the whole
          class becomes non-literal.  */
-      if (!literal_type_p (type))
+      if (COMPLETE_TYPE_P (type) && !literal_type_p (type))
         CLASSTYPE_LITERAL_P (t) = false;
 
       /* A standard-layout class is a class that:

  reply	other threads:[~2012-03-20 20:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 15:15 Paolo Carlini
2012-03-20 19:22 ` Jason Merrill
2012-03-20 20:17   ` Paolo Carlini
2012-03-20 20:38     ` Paolo Carlini [this message]
2012-03-22 14:49       ` Jason Merrill
2012-03-22 17:01         ` Paolo Carlini
2012-03-22 17:16           ` Gabriel Dos Reis
2012-03-22 18:29           ` Jason Merrill
2012-03-23  1:02             ` Paolo Carlini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F68E9F2.7070406@oracle.com \
    --to=paolo.carlini@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).