diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 20:19:51 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 20:19:51 +0000 |
commit | c19ee3f5471b312f3ae6e70453551150a3c293b4 (patch) | |
tree | f33260a7ccb7a432a194d5b0812d815cb7f717f9 /gcc/cp/typeck.c | |
parent | a46c112cb080a59e0f4a1a60a24f62b8551f5866 (diff) | |
download | gcc-c19ee3f5471b312f3ae6e70453551150a3c293b4.tar.gz |
PR c++/64297
* typeck.c (apply_memfn_quals): Correct wrong TYPE_CANONICAL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218763 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 7b39816bdb1..9368b49b012 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -8945,6 +8945,12 @@ apply_memfn_quals (tree type, cp_cv_quals memfn_quals, cp_ref_qualifier rqual) /* This should really have a different TYPE_MAIN_VARIANT, but that gets complex. */ tree result = build_qualified_type (type, memfn_quals); + if (tree canon = TYPE_CANONICAL (result)) + if (canon != result) + /* check_qualified_type doesn't check the ref-qualifier, so make sure + TYPE_CANONICAL is correct. */ + TYPE_CANONICAL (result) + = build_ref_qualified_type (canon, type_memfn_rqual (result)); result = build_exception_variant (result, TYPE_RAISES_EXCEPTIONS (type)); return build_ref_qualified_type (result, rqual); } |