aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-08-30 22:49:33 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-08-30 22:49:33 -0400
commit429f8106ec2d96dae1bef20302e99237b5aa37cf (patch)
tree4cb37c14af2e6aabc8c24dd33c6acbda16cac468 /gcc
parentda4aca78cf53d4a790e5f3fc2e4888d2e34ec92e (diff)
downloadgcc-429f8106ec2d96dae1bef20302e99237b5aa37cf.zip
gcc-429f8106ec2d96dae1bef20302e99237b5aa37cf.tar.gz
gcc-429f8106ec2d96dae1bef20302e99237b5aa37cf.tar.bz2
pt.c (instantiate_template_1): Keep processing_template_decl set if there are dependent args.
* pt.c (instantiate_template_1): Keep processing_template_decl set if there are dependent args. From-SVN: r190825
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 845f0b4..2eca678 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2012-08-30 Jason Merrill <jason@redhat.com>
+
+ * pt.c (instantiate_template_1): Keep processing_template_decl set
+ if there are dependent args.
+
2012-08-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51421
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f8ff1df..54d92df 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -14373,6 +14373,10 @@ instantiate_template_1 (tree tmpl, tree orig_args, tsubst_flags_t complain)
/* Instantiation of the function happens in the context of the function
template, not the context of the overload resolution we're doing. */
push_to_top_level ();
+ /* If there are dependent arguments, e.g. because we're doing partial
+ ordering, make sure processing_template_decl stays set. */
+ if (uses_template_parms (targ_ptr))
+ ++processing_template_decl;
if (DECL_CLASS_SCOPE_P (gen_tmpl))
{
tree ctx = tsubst (DECL_CONTEXT (gen_tmpl), targ_ptr,