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
0c8bfdbc
Commit
0c8bfdbc
authored
Sep 01, 1998
by
Mark Mitchell
Committed by
Mark Mitchell
Sep 01, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl2.c (arg_assoc): Handle template-id expressions as arguments.
From-SVN: r22156
parent
99d7f99a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
4 deletions
+79
-4
gcc/cp/ChangeLog
+4
-0
gcc/cp/decl2.c
+64
-4
gcc/testsuite/g++.old-deja/g++.pt/crash24.C
+11
-0
No files found.
gcc/cp/ChangeLog
View file @
0c8bfdbc
1998-09-01 Mark Mitchell <mark@markmitchell.com>
* decl2.c (arg_assoc): Handle template-id expressions as arguments.
1998-08-31 Mark Mitchell <mark@markmitchell.com>
* decl.c (finish_enum): Handle member enums of classes declared in
...
...
gcc/cp/decl2.c
View file @
0c8bfdbc
...
...
@@ -4583,11 +4583,71 @@ arg_assoc (k, n)
while
(
TREE_CODE
(
n
)
==
TREE_LIST
)
n
=
TREE_VALUE
(
n
);
my_friendly_assert
(
TREE_CODE
(
n
)
==
OVERLOAD
,
980715
);
if
(
TREE_CODE
(
n
)
==
TEMPLATE_ID_EXPR
)
{
/* [basic.lookup.koenig]
If T is a template-id, its associated namespaces and classes
are the namespace in which the template is defined; for
member templates, the member template's class; the namespaces
and classes associated with the types of the template
arguments provided for template type parameters (excluding
template template parameters); the namespaces in which any
template template arguments are defined; and the classes in
which any member templates used as template template
arguments are defined. [Note: non-type template arguments do
not contribute to the set of associated namespaces. ] */
tree
template
=
TREE_OPERAND
(
n
,
0
);
tree
args
=
TREE_OPERAND
(
n
,
1
);
tree
ctx
;
tree
arg
;
/* First, the template. There may actually be more than one if
this is an overloaded function template. But, in that case,
we only need the first; all the functions will be in the same
namespace. */
template
=
OVL_CURRENT
(
template
);
ctx
=
CP_DECL_CONTEXT
(
template
);
if
(
TREE_CODE
(
ctx
)
==
NAMESPACE_DECL
)
{
if
(
arg_assoc_namespace
(
k
,
ctx
)
==
1
)
return
1
;
}
/* It must be a member template. */
else
if
(
arg_assoc_class
(
k
,
ctx
)
==
1
)
return
1
;
for
(;
n
;
n
=
TREE_CHAIN
(
n
))
if
(
arg_assoc
(
k
,
OVL_FUNCTION
(
n
)))
return
1
;
/* Now the arguments. */
for
(
arg
=
args
;
arg
!=
NULL_TREE
;
arg
=
TREE_CHAIN
(
arg
))
{
tree
t
=
TREE_VALUE
(
arg
);
if
(
TREE_CODE
(
t
)
==
TEMPLATE_DECL
)
{
ctx
=
CP_DECL_CONTEXT
(
t
);
if
(
TREE_CODE
(
ctx
)
==
NAMESPACE_DECL
)
{
if
(
arg_assoc_namespace
(
k
,
ctx
)
==
1
)
return
1
;
}
else
if
(
arg_assoc_class
(
k
,
ctx
)
==
1
)
return
1
;
}
else
if
(
TREE_CODE_CLASS
(
TREE_CODE
(
t
))
==
't'
&&
arg_assoc_type
(
t
)
==
1
)
return
1
;
}
}
else
{
my_friendly_assert
(
TREE_CODE
(
n
)
==
OVERLOAD
,
980715
);
for
(;
n
;
n
=
OVL_CHAIN
(
n
))
if
(
arg_assoc
(
k
,
OVL_FUNCTION
(
n
)))
return
1
;
}
return
0
;
}
...
...
gcc/testsuite/g++.old-deja/g++.pt/crash24.C
0 → 100644
View file @
0c8bfdbc
// Build don't link:
template
<
typename
T
,
template
<
class
>
class
U
>
void
template_fn
(
T
);
template
<
typename
T
,
typename
U
>
void
callme
(
void
(
*
)(
T
));
template
<
typename
T
>
struct
S1
;
int
main
()
{
callme
(
template_fn
<
double
,
S1
>
);
// ERROR - no matching function
}
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