diff options
author | Jason Merrill <jason@redhat.com> | 2014-10-11 21:42:31 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-10-11 21:42:31 -0400 |
commit | d1522e8f63167d81f6bd77c5d29ffdba2e6fbe86 (patch) | |
tree | 52a295c7a10b57d2b3007a653db61008c5031b70 /gcc/cp/rtti.c | |
parent | a4b9dcad0837d3bc03843df6f96e6cb830550af6 (diff) | |
download | gcc-d1522e8f63167d81f6bd77c5d29ffdba2e6fbe86.zip gcc-d1522e8f63167d81f6bd77c5d29ffdba2e6fbe86.tar.gz gcc-d1522e8f63167d81f6bd77c5d29ffdba2e6fbe86.tar.bz2 |
re PR c++/62115 (ICE with invalid default argument)
PR c++/62115
* class.c (build_base_path): Preserve rvalueness.
* call.c (convert_like_real) [ck_base]: Let convert_to_base handle &/*.
* rtti.c (build_dynamic_cast_1): Call convert_to_reference later.
From-SVN: r216124
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 10cc168..762953b 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -608,10 +608,6 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) errstr = _("source is of incomplete class type"); goto fail; } - - /* Apply trivial conversion T -> T& for dereferenced ptrs. */ - expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT, - LOOKUP_NORMAL, NULL_TREE, complain); } /* The dynamic_cast operator shall not cast away constness. */ @@ -631,6 +627,11 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) return build_static_cast (type, expr, complain); } + /* Apply trivial conversion T -> T& for dereferenced ptrs. */ + if (tc == REFERENCE_TYPE) + expr = convert_to_reference (exprtype, expr, CONV_IMPLICIT, + LOOKUP_NORMAL, NULL_TREE, complain); + /* Otherwise *exprtype must be a polymorphic class (have a vtbl). */ if (TYPE_POLYMORPHIC_P (TREE_TYPE (exprtype))) { |