From 5bae129abaa0c6a149d0c6028c7cd36568ddb40b Mon Sep 17 00:00:00 2001 From: paolo Date: Thu, 31 May 2007 08:58:47 +0000 Subject: [PATCH] gcc/cp 2007-05-31 Paolo Carlini PR c++/32158 * semantics.c (finish_trait_expr): Complete the types. gcc/testsuite 2007-05-31 Paolo Carlini PR c++/32158 * g++.dg/ext/is_pod_incomplete.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125217 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 6 +++++- gcc/testsuite/ChangeLog | 7 ++++++- gcc/testsuite/g++.dg/ext/is_pod_incomplete.C | 8 ++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/is_pod_incomplete.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 22171e4..885af4f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2007-05-31 Paolo Carlini + + PR c++/32158 + * semantics.c (finish_trait_expr): Complete the types. + 2007-05-30 Russell Yanofsky Douglas Gregor Pedro Lamarao diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 631f5e8..4a9ea8c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4177,11 +4177,15 @@ finish_trait_expr (cp_trait_kind kind, tree type1, tree type2) return trait_expr; } + complete_type (type1); + if (type2) + complete_type (type2); + /* The only required diagnostic. */ if (kind == CPTK_IS_BASE_OF && NON_UNION_CLASS_TYPE_P (type1) && NON_UNION_CLASS_TYPE_P (type2) && !same_type_ignoring_top_level_qualifiers_p (type1, type2) - && !COMPLETE_TYPE_P (complete_type (type2))) + && !COMPLETE_TYPE_P (type2)) { error ("incomplete type %qT not allowed", type2); return error_mark_node; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 045a336..70853cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2007-05-31 Paul Thomas PR fortran/32103 * gfortran.dg/module_equivalence_3.f90: New test. 2007-05-30 Russell Yanofsky +2007-05-31 Paolo Carlini + + PR c++/32158 + * g++.dg/ext/is_pod_incomplete.C: New. + +2007-05-31 Russell Yanofsky Douglas Gregor Pedro Lamarao Howard Hinnant diff --git a/gcc/testsuite/g++.dg/ext/is_pod_incomplete.C b/gcc/testsuite/g++.dg/ext/is_pod_incomplete.C new file mode 100644 index 0000000..a30ab1f --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/is_pod_incomplete.C @@ -0,0 +1,8 @@ +// PR c++/32158 +template + struct A + { + A() { } + }; + +int t[__is_pod(A)?-1:1]; -- 2.7.4