Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
fcb7afc2
Commit
fcb7afc2
authored
Sep 26, 2011
by
Jason Merrill
Committed by
Jason Merrill
Sep 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* pt.c (tsubst_copy) [PARM_DECL]: Handle 'this' in NSDMI.
From-SVN: r179201
parent
8fb3401b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
gcc/cp/ChangeLog
+4
-0
gcc/cp/pt.c
+7
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C
+1
-0
gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
+21
-0
No files found.
gcc/cp/ChangeLog
View file @
fcb7afc2
2011-09-26 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_copy) [PARM_DECL]: Handle 'this' in NSDMI.
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* pt.c (convert_nontype_argument): Handle NULLPTR_TYPE.
...
...
gcc/cp/pt.c
View file @
fcb7afc2
...
...
@@ -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. */
...
...
gcc/testsuite/ChangeLog
View file @
fcb7afc2
2011-09-26 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/nsdmi-template1.C: New.
2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/nullptr25.C: New.
...
...
gcc/testsuite/g++.dg/cpp0x/nsdmi-defer4.C
View file @
fcb7afc2
// { dg-options -std=c++0x }
// { dg-do run }
struct
A
{
...
...
gcc/testsuite/g++.dg/cpp0x/nsdmi-template1.C
0 → 100644
View file @
fcb7afc2
// { dg-do run }
// { dg-options -std=c++0x }
struct
base
{
int
calc_avg
()
{
return
42
;
}
};
template
<
class
T
>
struct
nsdmi
:
T
{
nsdmi
()
{}
int
avg
()
{
return
avg_
;
}
int
avg_
=
this
->
calc_avg
();
};
int
main
()
{
nsdmi
<
base
>
x
;
if
(
x
.
avg
()
!=
42
)
__builtin_abort
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment