aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorKamlesh Kumar <kamleshbhalui@gmail.com>2019-10-21 20:19:28 +0000
committerJason Merrill <jason@gcc.gnu.org>2019-10-21 16:19:28 -0400
commitdebf1662d1f0cbe54198119f1a74baf46ad6a41a (patch)
treed37b77eabd78fced6e683868f4fc7bd028499058 /gcc/cp/rtti.c
parent79cd6c7b905ca9390bc1e7c87c259a5a18cefa81 (diff)
downloadgcc-debf1662d1f0cbe54198119f1a74baf46ad6a41a.zip
gcc-debf1662d1f0cbe54198119f1a74baf46ad6a41a.tar.gz
gcc-debf1662d1f0cbe54198119f1a74baf46ad6a41a.tar.bz2
PR c++/83434 - typeinfo for noexcept function lacks noexcept information
2019-10-21 Kamlesh Kumar <kamleshbhalui@gmail.com> * rtti.c (get_tinfo_decl_dynamic): Do not call TYPE_MAIN_VARIANT for function. (get_typeid): Likewise. * g++.dg/rtti/pr83534.C: New Test. Reviewed-by: Jason Merrill <jason@redhat.com> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r277270
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index eb1b062..c905799 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -272,11 +272,11 @@ get_tinfo_decl_dynamic (tree exp, tsubst_flags_t complain)
exp = resolve_nondeduced_context (exp, complain);
- /* peel back references, so they match. */
+ /* Peel back references, so they match. */
type = non_reference (unlowered_expr_type (exp));
/* Peel off cv qualifiers. */
- type = TYPE_MAIN_VARIANT (type);
+ type = cv_unqualified (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
if (CLASS_TYPE_P (type) || type == unknown_type_node
@@ -300,7 +300,7 @@ get_tinfo_decl_dynamic (tree exp, tsubst_flags_t complain)
}
else
/* Otherwise return the type_info for the static type of the expr. */
- t = get_tinfo_ptr (TYPE_MAIN_VARIANT (type));
+ t = get_tinfo_ptr (type);
return cp_build_fold_indirect_ref (t);
}
@@ -518,7 +518,7 @@ get_typeid (tree type, tsubst_flags_t complain)
/* The top-level cv-qualifiers of the lvalue expression or the type-id
that is the operand of typeid are always ignored. */
- type = TYPE_MAIN_VARIANT (type);
+ type = cv_unqualified (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
if (CLASS_TYPE_P (type) || type == unknown_type_node