summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-08 15:02:27 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-08 15:02:27 +0000
commit9048afbab011f6b83593cfd8defbf550f105e474 (patch)
tree0fb907c613404cb51fc13195229623032544696d
parent38bc362151f15e9ffe7e9315dd50ad500a997817 (diff)
downloadgcc-9048afbab011f6b83593cfd8defbf550f105e474.tar.gz
/cp
2015-09-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67369 * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst if the first argument isn't a template. /testsuite 2015-09-08 Paolo Carlini <paolo.carlini@oracle.com> PR c++/67369 * g++.dg/cpp1y/lambda-generic-ice4.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@227531 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C10
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b935e08d984..7695d48436b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/67369
+ * pt.c (tsubst_copy, [case FUNCTION_DECL]): Do not call tsubst
+ if the first argument isn't a template.
+
2015-08-17 Jason Merrill <jason@redhat.com>
PR c++/66957
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index aca69906298..9ac7ed14d84 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -13110,8 +13110,9 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (r)
{
/* Make sure that the one we found is the one we want. */
- tree ctx = tsubst (DECL_CONTEXT (t), args,
- complain, in_decl);
+ tree ctx = DECL_CONTEXT (t);
+ if (DECL_LANG_SPECIFIC (ctx) && DECL_TEMPLATE_INFO (ctx))
+ ctx = tsubst (ctx, args, complain, in_decl);
if (ctx != DECL_CONTEXT (r))
r = NULL_TREE;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dd4a9b326b4..01dfe84f752 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/67369
+ * g++.dg/cpp1y/lambda-generic-ice4.C: New.
+
2015-09-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67452
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C
new file mode 100644
index 00000000000..ec4db83b6e4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice4.C
@@ -0,0 +1,10 @@
+// PR c++/67369
+// { dg-do compile { target c++14 } }
+
+int main() {
+ unsigned const nsz = 0;
+ auto repeat_conditional = [&](auto) {
+ auto new_sz = nsz;
+ };
+ repeat_conditional(1);
+}