summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-lang.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-23 09:02:12 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2003-12-23 09:02:12 +0000
commit21e56b66fadbdd59e94d50e33db47d962330b5e8 (patch)
treeae015fce692d5b02e73ddf17575b92ccb278820c /gcc/cp/cp-lang.c
parentac365bcb0c55a8645b17179ce976e1218e628d45 (diff)
downloadgcc-21e56b66fadbdd59e94d50e33db47d962330b5e8.tar.gz
PR c++/13387
* cp-lang.c (cxx_get_alias_set): Correct logic for a base type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74968 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-lang.c')
-rw-r--r--gcc/cp/cp-lang.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index d9959e031ed..94cf4623ee8 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -292,11 +292,12 @@ ok_to_generate_alias_set_for_type (tree t)
static HOST_WIDE_INT
cxx_get_alias_set (tree t)
{
- if (CLASS_TYPE_P (t) && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t))
+ if (TREE_CODE (t) == RECORD_TYPE
+ && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t))
&& CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t)
/* The base variant of a type must be in the same alias set as the
complete type. */
- t = TYPE_CONTEXT (t);
+ return get_alias_set (TYPE_CONTEXT (t));
if (/* It's not yet safe to use alias sets for some classes in C++. */
!ok_to_generate_alias_set_for_type (t)