Commit debd777c by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/46001 (diagnostic refers to type '__java_boolean')

	PR c++/46001
	* decl.c (record_builtin_java_type): Call build_distinct_type_copy
	on build_nonstandard_integer_type result for __java_* types.

	* g++.dg/diagnostic/bitfld1.C: New test.

From-SVN: r167698
parent cfee318d
2010-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/46001
* decl.c (record_builtin_java_type): Call build_distinct_type_copy
on build_nonstandard_integer_type result for __java_* types.
2010-12-10 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.
......
......@@ -3330,17 +3330,22 @@ record_builtin_java_type (const char* name, int size)
{
tree type, decl;
if (size > 0)
type = build_nonstandard_integer_type (size, 0);
{
type = build_nonstandard_integer_type (size, 0);
type = build_distinct_type_copy (type);
}
else if (size > -32)
{
tree stype;
/* "__java_char" or ""__java_boolean". */
type = build_nonstandard_integer_type (-size, 1);
type = build_distinct_type_copy (type);
/* Get the signed type cached and attached to the unsigned type,
so it doesn't get garbage-collected at "random" times,
causing potential codegen differences out of different UIDs
and different alias set numbers. */
stype = build_nonstandard_integer_type (-size, 0);
stype = build_distinct_type_copy (stype);
TREE_CHAIN (type) = stype;
/*if (size == -1) TREE_SET_CODE (type, BOOLEAN_TYPE);*/
}
......
2010-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/46001
* g++.dg/diagnostic/bitfld1.C: New test.
2010-12-10 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/43023
......
// PR c++/46001
// { dg-do compile }
struct S
{
char *p;
unsigned char f : 1;
};
struct S s;
void *a = s.p | s.f; // { dg-error "unsigned char:1" }
// { dg-bogus "__java_boolean" "" { target *-*-* } 11 }
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