aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-02-10 12:20:01 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-02-10 12:20:01 -0500
commit0ec052fe44254693b9e8c0640c8c04ee3099de4b (patch)
tree8c21095cac2575d43649c0ccfcfa5861c9b77417
parent082908e33d11405196e37f2a6feaefae7e013cd4 (diff)
downloadgcc-0ec052fe44254693b9e8c0640c8c04ee3099de4b.zip
gcc-0ec052fe44254693b9e8c0640c8c04ee3099de4b.tar.gz
gcc-0ec052fe44254693b9e8c0640c8c04ee3099de4b.tar.bz2
re PR c++/64994 (Firefox build error: ICE: in cxx_eval_call_expression, at cp/constexpr.c:1353)
PR c++/64994 * constexpr.c (cxx_eval_call_expression): Walk the clone list. From-SVN: r220589
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/constexpr.c8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ctor18.C26
3 files changed, 37 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7e282d8..73d1b93 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/64994
+ * constexpr.c (cxx_eval_call_expression): Walk the clone list.
+
2015-02-10 Jan Hubicka <hubicka@ucw.cz>
PR ipa/64982
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index f143420..2b56cb2 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -1348,8 +1348,12 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
if (DECL_SAVED_TREE (fun) == NULL_TREE
&& (DECL_CONSTRUCTOR_P (fun) || DECL_DESTRUCTOR_P (fun)))
/* The maybe-in-charge 'tor had its DECL_SAVED_TREE
- cleared, try the first clone. */
- fun = DECL_CHAIN (fun);
+ cleared, try a clone. */
+ for (fun = DECL_CHAIN (fun);
+ fun && DECL_CLONED_FUNCTION_P (fun);
+ fun = DECL_CHAIN (fun))
+ if (DECL_SAVED_TREE (fun))
+ break;
gcc_assert (DECL_SAVED_TREE (fun));
tree parms, res;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor18.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor18.C
new file mode 100644
index 0000000..fa4ff7c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor18.C
@@ -0,0 +1,26 @@
+// PR c++/64994
+// { dg-do compile { target c++11 } }
+
+class TimeStamp {
+public:
+ constexpr TimeStamp() : mValue() {}
+ int mValue;
+};
+
+class A {
+ class B;
+ A(bool);
+};
+class C {
+ TimeStamp mFadeBeginTime;
+};
+class A::B {
+public:
+ B(int) {}
+ TimeStamp mPrevEventTime[1];
+};
+
+A::A(bool) {
+ new C;
+ B(0);
+}