diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 21:15:13 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 21:15:13 +0000 |
commit | 4730466b5737baca4efd606025cb52b019fd6613 (patch) | |
tree | 04e8ce07ecd9ef6d8a2ee44b60e0862acc2f4b41 /gcc | |
parent | 6ea7787af87e4cb5faa0008ccdc00e5b6a41520d (diff) | |
download | gcc-4730466b5737baca4efd606025cb52b019fd6613.tar.gz |
PR c++/45983
* tree.c (cp_build_qualified_type_real): Don't reuse a variant
with a different typedef variant of the element type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165521 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lto/pr45983_0.C | 20 |
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 20ca6a6fef2..16b930793ed 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-10-15 Jason Merrill <jason@redhat.com> + + PR c++/45983 + * tree.c (cp_build_qualified_type_real): Don't reuse a variant + with a different typedef variant of the element type. + 2010-10-14 Iain Sandoe <iains@gcc.gnu.org> merge from FSF apple 'trunk' branch. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 93d13a1ec2b..b8f76b02a18 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -810,7 +810,7 @@ cp_build_qualified_type_real (tree type, /* See if we already have an identically qualified type. Tests should be equivalent to those in check_qualified_type. */ for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) - if (cp_type_quals (t) == type_quals + if (TREE_TYPE (t) == element_type && TYPE_NAME (t) == TYPE_NAME (type) && TYPE_CONTEXT (t) == TYPE_CONTEXT (type) && attribute_list_equal (TYPE_ATTRIBUTES (t), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c61580225f3..deec8b82cae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-10-15 Jason Merrill <jason@redhat.com> + + * g++.dg/lto/pr45983_0.C: New. + 2010-10-14 Michael Meissner <meissner@linux.vnet.ibm.com> * gcc.target/powerpc/ppc-fma-1.c: New tests for powerpc FMA diff --git a/gcc/testsuite/g++.dg/lto/pr45983_0.C b/gcc/testsuite/g++.dg/lto/pr45983_0.C new file mode 100644 index 00000000000..a2c9ba6092d --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr45983_0.C @@ -0,0 +1,20 @@ +// PR c++/45983 + +template <int N> +class T1 { + int m[N]; + typedef float scalar_type_t; + typedef scalar_type_t scalar_array_t[1]; + const scalar_array_t &decay(void) const; +}; +class T2 { +public: + float vals[1]; + float get_value(void) const { return vals[0]; } +}; +T2 channel_params; +float output_audio(void) { + return channel_params.get_value(); +} + +int main(){} |