d: Set TYPE_ARTIFICIAL on internal TypeInfo types
Prevents them from triggering warnings when compiling with `-Wpadded'.
gcc/d/ChangeLog:
* typeinfo.cc (make_internal_typeinfo): Set TYPE_ARTIFICIAL.
gcc/testsuite/ChangeLog:
* gdc.dg/Wpadded.d: New test.
(cherry picked from commit 57b2adae53
)
This commit is contained in:
parent
bac09a8931
commit
5f4931ec99
|
@ -180,6 +180,7 @@ make_internal_typeinfo (tinfo_kind tk, Identifier *ident, ...)
|
|||
|
||||
/* Create the TypeInfo type. */
|
||||
tree type = make_node (RECORD_TYPE);
|
||||
TYPE_ARTIFICIAL (type) = 1;
|
||||
finish_builtin_struct (type, ident->toChars (), fields, NULL_TREE);
|
||||
|
||||
tinfo_types[tk] = type;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
// { dg-do compile }
|
||||
// { dg-options "-Wpadded" }
|
||||
|
||||
class EmptyClass { }
|
Loading…
Reference in New Issue