diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 2c398e0..cac45f9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11750,6 +11750,13 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) if (r == NULL) { tree c; + + /* We get here for a use of 'this' in an NSDMI. */ + if (DECL_NAME (t) == this_identifier + && at_function_scope_p () + && DECL_CONSTRUCTOR_P (current_function_decl)) + return current_class_ptr; + /* This can happen for a parameter name used later in a function declaration (such as in a late-specified return type). Just make a dummy decl, since it's only used for its type. */ |