diff options
-rw-r--r-- | gcc/cp/rtti.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/dfp/mangle-6.C | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 5a33b83afd0..82eaa286514 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -433,7 +433,7 @@ get_tinfo_decl_direct (tree type, tree name, int pseudo_ix) if (!name) name = mangle_typeinfo_for_type (type); - if (!CLASS_TYPE_P (type)) + if (!CLASS_TYPE_P (type) || TYPE_TRANSPARENT_AGGR (type)) d = get_global_binding (name); if (!d) diff --git a/gcc/testsuite/g++.dg/dfp/mangle-6.C b/gcc/testsuite/g++.dg/dfp/mangle-6.C new file mode 100644 index 00000000000..9cfb2a974bb --- /dev/null +++ b/gcc/testsuite/g++.dg/dfp/mangle-6.C @@ -0,0 +1,19 @@ +// PR c++/100261 +// { dg-do compile } + +#include <typeinfo> + +namespace std { + namespace decimal { + class decimal32 { + float private__decfloat32; + }; + } +} + +void +foo () +{ + typeid (float); + typeid (std::decimal::decimal32); +} |