+2011-12-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51316
+ * c-common.c (c_sizeof_or_alignof_type): In C++ allow for alignof
+ of array types with an unknown bound.
+
2011-12-20 Joseph Myers <joseph@codesourcery.com>
* c-common.c (flag_isoc99): Update comment to refer to C11.
return error_mark_node;
value = size_one_node;
}
- else if (!COMPLETE_TYPE_P (type))
+ else if (!COMPLETE_TYPE_P (type)
+ && (!c_dialect_cxx () || is_sizeof || type_code != ARRAY_TYPE))
{
if (complain)
- error_at (loc, "invalid application of %qs to incomplete type %qT ",
+ error_at (loc, "invalid application of %qs to incomplete type %qT",
op_name, type);
return error_mark_node;
}
+ else if (c_dialect_cxx () && type_code == ARRAY_TYPE
+ && !COMPLETE_TYPE_P (TREE_TYPE (type)))
+ {
+ if (complain)
+ error_at (loc, "invalid application of %qs to array type %qT of "
+ "incomplete element type", op_name, type);
+ return error_mark_node;
+ }
else
{
if (is_sizeof)
+2011-12-30 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/51316
+ * g++.dg/cpp0x/alignof4.C: New.
+
2011-12-29 Michael Meissner <meissner@linux.vnet.ibm.com>
PR testsuite/51702