This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[c++-concepts] introduction syntax regression

The original patch for concept introductions was not popping a
deferred access check. This fixes that problem, although I'm not sure
if we need to defer access checks at all.

2014-10-13  Andrew Sutton  <>

        Fix regression related to concept introductions.
        * gcc/cp/ (cp_parser_template_declaration_after_exp):
        Pop deferred access checks afer parsing the introduction.

Andrew Sutton
Index: parser.c
--- parser.c	(revision 214991)
+++ parser.c	(working copy)
@@ -24409,19 +24409,21 @@ cp_parser_template_declaration_after_exp
 	    = current_template_reqs;
-  else if(flag_concepts)
+  else if (flag_concepts)
       need_lang_pop = false;
       checks = NULL;
       saved_template_reqs = release (current_template_reqs);
-      push_deferring_access_checks (dk_deferred);
       // Scope may be changed by a nested-name-specifier.
       tree saved_scope = parser->scope;
       tree saved_qualifying_scope = parser->qualifying_scope;
       tree saved_object_scope = parser->object_scope;
+      push_deferring_access_checks (dk_deferred);
       parameter_list = cp_parser_template_introduction (parser);
+      pop_deferring_access_checks ();
       if (parameter_list == error_mark_node)
 	  // Restore template requirements before returning.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]