aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-01-27 11:48:34 -0500
committerJason Merrill <jason@gcc.gnu.org>2017-01-27 11:48:34 -0500
commit20f058d0986d8e7f81c1e45217b6d4c361dc089b (patch)
tree95c5d020797f1cfdd1538426d670c45790934a50 /gcc/cp/method.c
parenta7d47f352663d16c12cb3a40459b546d166023d7 (diff)
downloadgcc-20f058d0986d8e7f81c1e45217b6d4c361dc089b.zip
gcc-20f058d0986d8e7f81c1e45217b6d4c361dc089b.tar.gz
gcc-20f058d0986d8e7f81c1e45217b6d4c361dc089b.tar.bz2
PR c++/78771 - ICE with inherited constructor.
* call.c (build_over_call): Call deduce_inheriting_ctor here. * pt.c (tsubst_decl): Not here. * class.c (add_method): Or here. * method.c (deduce_inheriting_ctor): Handle clones. (implicitly_declare_fn): Don't deduce inheriting ctors yet. From-SVN: r244988
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 5b366f0..e80b806 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1855,6 +1855,7 @@ explain_implicit_non_constexpr (tree decl)
void
deduce_inheriting_ctor (tree decl)
{
+ decl = DECL_ORIGIN (decl);
gcc_assert (DECL_INHERITED_CTOR (decl));
tree spec;
bool trivial, constexpr_, deleted;
@@ -1868,6 +1869,13 @@ deduce_inheriting_ctor (tree decl)
deleted = true;
DECL_DELETED_FN (decl) = deleted;
TREE_TYPE (decl) = build_exception_variant (TREE_TYPE (decl), spec);
+
+ tree clone;
+ FOR_EACH_CLONE (clone, decl)
+ {
+ DECL_DELETED_FN (clone) = deleted;
+ TREE_TYPE (clone) = build_exception_variant (TREE_TYPE (clone), spec);
+ }
}
/* Implicitly declare the special function indicated by KIND, as a
@@ -1968,10 +1976,10 @@ implicitly_declare_fn (special_function_kind kind, tree type,
bool trivial_p = false;
- if (inherited_ctor && TREE_CODE (inherited_ctor) == TEMPLATE_DECL)
+ if (inherited_ctor)
{
- /* For an inheriting constructor template, just copy these flags from
- the inherited constructor template for now. */
+ /* For an inheriting constructor, just copy these flags from the
+ inherited constructor until deduce_inheriting_ctor. */
raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (inherited_ctor));
deleted_p = DECL_DELETED_FN (inherited_ctor);
constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor);