if (args && is_this_parameter (args))
{
gcc_checking_assert (current_class_ptr == NULL_TREE);
- current_class_ptr = NULL_TREE;
current_class_ref = cp_build_fold_indirect_ref (args);
current_class_ptr = args;
}
tree pushed_scope = NULL_TREE;
unsigned ix;
cp_default_arg_entry *e;
- tree save_ccp, save_ccr;
if (!type_definition_ok_p || any_erroneous_template_args_p (type))
{
/* If there are noexcept-specifiers that have not yet been processed,
take care of them now. Do this before processing NSDMIs as they
may depend on noexcept-specifiers already having been processed. */
+ tree save_ccp = current_class_ptr;
+ tree save_ccr = current_class_ref;
FOR_EACH_VEC_SAFE_ELT (unparsed_noexcepts, ix, decl)
{
tree ctx = DECL_CONTEXT (decl);
/* Make sure that any template parameters are in scope. */
maybe_begin_member_template_processing (decl);
- /* Make sure that any member-function parameters are in scope. */
+ /* Make sure that any member-function parameters are in scope.
+ This function doesn't expect ccp to be set. */
+ current_class_ptr = current_class_ref = NULL_TREE;
inject_parm_decls (decl);
/* 'this' is not allowed in static member functions. */
vec_safe_truncate (unparsed_noexcepts, 0);
/* Now parse any NSDMIs. */
- save_ccp = current_class_ptr;
- save_ccr = current_class_ref;
FOR_EACH_VEC_SAFE_ELT (unparsed_nsdmis, ix, decl)
{
if (class_type != DECL_CONTEXT (decl))
--- /dev/null
+// PR c++/96623
+// { dg-do compile { target c++11 } }
+
+constexpr int x = 0;
+struct A {
+ int a1;
+ void foo (int p) {
+ int foovar;
+ struct B {
+ int b1;
+ void bar1 () noexcept(x);
+ void bar2 () noexcept(noexcept(this->b1));
+ void bar3 () noexcept(noexcept(this->b2));
+ void bar4 () noexcept(noexcept(a1));
+ void bar5 () noexcept(noexcept(a2));
+ void bar6 () noexcept(noexcept(b1));
+ void bar7 () noexcept(noexcept(b2));
+ void bar8 () noexcept(noexcept(foovar));
+ void bar9 () noexcept(noexcept(p));
+ int b2;
+ };
+ }
+ int a2;
+};