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
94aedc1c
Commit
94aedc1c
authored
Jun 16, 2018
by
Jason Merrill
Committed by
Jason Merrill
Jun 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR c++/86147 - wrong capture for template argument.
* expr.c (mark_use): Look through NOP_EXPR. From-SVN: r261676
parent
29305f60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
gcc/cp/ChangeLog
+3
-0
gcc/cp/expr.c
+8
-5
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C
+17
-0
No files found.
gcc/cp/ChangeLog
View file @
94aedc1c
2018-06-15 Jason Merrill <jason@redhat.com>
2018-06-15 Jason Merrill <jason@redhat.com>
PR c++/86147 - wrong capture for template argument.
* expr.c (mark_use): Look through NOP_EXPR.
* name-lookup.c (do_pushtag): Don't look through complete types, but
* name-lookup.c (do_pushtag): Don't look through complete types, but
don't add to them either. Get context from current_binding_level.
don't add to them either. Get context from current_binding_level.
* pt.c (tsubst_default_argument): Use push_to/pop_from_top_level.
* pt.c (tsubst_default_argument): Use push_to/pop_from_top_level.
...
...
gcc/cp/expr.c
View file @
94aedc1c
...
@@ -186,12 +186,15 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
...
@@ -186,12 +186,15 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
expr
=
convert_from_reference
(
r
);
expr
=
convert_from_reference
(
r
);
}
}
break
;
break
;
default:
CASE_CONVERT:
case
VIEW_CONVERT_EXPR
:
if
(
location_wrapper_p
(
expr
))
if
(
location_wrapper_p
(
expr
))
{
loc
=
EXPR_LOCATION
(
expr
);
loc
=
EXPR_LOCATION
(
expr
);
recurse_op
[
0
]
=
true
;
recurse_op
[
0
]
=
true
;
break
;
}
default:
break
;
break
;
}
}
...
...
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const9.C
0 → 100644
View file @
94aedc1c
// PR c++/86147
// { dg-do compile { target c++11 } }
template
<
class
T
,
T
N
>
struct
X
{
};
struct
A
{
static
constexpr
int
value
=
0
;
};
template
<
class
C
>
void
foo
()
{
constexpr
int
N
=
C
::
value
;
auto
f
=
[
&
]{
X
<
int
,
N
>
a
;
};
}
int
main
()
{
foo
<
A
>
();
return
0
;
}
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