Commit 48d261d2 by Paolo Carlini Committed by Paolo Carlini

re PR c++/52487 ([C++11] ICE at cp/semantics.c:5613 with lambda capturing…

re PR c++/52487 ([C++11] ICE at cp/semantics.c:5613 with lambda capturing reference to incomplete type by value)

/cp
2012-03-22  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-22  Paolo Carlini  <paolo.carlini@oracle.com>

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

From-SVN: r185722
parent d7bdd048
2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52487
* class.c (check_field_decls): Call literal_type_p only
on complete types.
2012-03-22 Jakub Jelinek <jakub@redhat.com> 2012-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/52671 PR c++/52671
......
...@@ -3149,8 +3149,9 @@ check_field_decls (tree t, tree *access_decls, ...@@ -3149,8 +3149,9 @@ check_field_decls (tree t, tree *access_decls,
CLASSTYPE_NON_AGGREGATE (t) = 1; CLASSTYPE_NON_AGGREGATE (t) = 1;
/* If at least one non-static data member is non-literal, the whole /* If at least one non-static data member is non-literal, the whole
class becomes non-literal. */ class becomes non-literal. Note: if the type is incomplete we
if (!literal_type_p (type)) will complain later on. */
if (COMPLETE_TYPE_P (type) && !literal_type_p (type))
CLASSTYPE_LITERAL_P (t) = false; CLASSTYPE_LITERAL_P (t) = false;
/* A standard-layout class is a class that: /* A standard-layout class is a class that:
......
2012-03-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52487
* g++.dg/cpp0x/lambda/lambda-ice7.C: New.
2012-03-22 Jakub Jelinek <jakub@redhat.com> 2012-03-22 Jakub Jelinek <jakub@redhat.com>
PR c++/52671 PR c++/52671
......
// 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" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment