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
73aad9b9
Commit
73aad9b9
authored
Aug 13, 1996
by
Jason Merrill
Committed by
Mike Stump
Aug 13, 1996
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
87th Cygnus<->FSF quick merge
From-SVN: r12630
parent
c8c2dcdc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
463 additions
and
114 deletions
+463
-114
gcc/cp/ChangeLog
+46
-0
gcc/cp/call.c
+31
-42
gcc/cp/cp-tree.h
+5
-2
gcc/cp/decl.c
+5
-2
gcc/cp/decl2.c
+21
-5
gcc/cp/errfn.c
+6
-5
gcc/cp/parse.y
+12
-2
gcc/cp/pt.c
+307
-45
gcc/cp/tree.c
+29
-2
gcc/cp/typeck.c
+1
-9
No files found.
gcc/cp/ChangeLog
View file @
73aad9b9
Mon Aug 12 00:09:18 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (end_template_decl): If we don't actually have parms, return.
* parse.y (template_header): Accept 'template <>'.
* errfn.c: Allow 5 args.
Sun Aug 11 15:20:58 1996 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (make_temp_vec): New fn.
* pt.c (push_template_decl): Handle partial specs.
(instantiate_class_template): Ditto.
(more_specialized): Use get_bindings.
(more_specialized_class): New fn.
(get_class_bindings): New fn.
(most_specialized_class): New fn.
(do_function_instantiation): List candidates for ambiguous case.
* decl.c (duplicate_decls): Lose reference to DECL_TEMPLATE_MEMBERS.
(shadow_tag): Call push_template_decl for partial specializations.
* parse.y: Ditto.
* cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Replaces
DECL_TEMPLATE_MEMBERS.
* call.c (print_z_candidates): Reduce duplication.
Fri Aug 9 14:36:08 1996 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (lang_decode_option): Allow -fansi-overloading.
Thu Aug 8 17:04:18 1996 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (get_bindings): New fn.
(most_specialized): Ditto.
(do_function_instantiation): Use them.
(add_maybe_template): New fn.
* cp-tree.h (DECL_MAYBE_TEMPLATE): New macro.
* call.c (build_new_op): Handle guiding decls.
(build_new_function_call): Ditto.
* decl2.c (finish_file): Ditto.
* decl2.c (mark_used): Do synthesis here.
* call.c (build_method_call): Not here.
(build_over_call): Or here.
* typeck.c (build_function_call_real): Or here.
* tree.c (bot_manip): Call mark_used on functions used in default
args.
Thu Aug 8 17:48:16 1996 Michael Meissner <meissner@tiktok.cygnus.com>
Thu Aug 8 17:48:16 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* decl2.c (import_export_vtable): Delete code that disabled vtable
* decl2.c (import_export_vtable): Delete code that disabled vtable
...
...
gcc/cp/call.c
View file @
73aad9b9
...
@@ -2468,12 +2468,6 @@ build_method_call (instance, name, parms, basetype_path, flags)
...
@@ -2468,12 +2468,6 @@ build_method_call (instance, name, parms, basetype_path, flags)
function
=
DECL_MAIN_VARIANT
(
function
);
function
=
DECL_MAIN_VARIANT
(
function
);
mark_used
(
function
);
mark_used
(
function
);
/* Is it a synthesized method that needs to be synthesized? */
if
(
DECL_ARTIFICIAL
(
function
)
&&
!
DECL_INITIAL
(
function
)
/* Kludge: don't synthesize for default args. */
&&
current_function_decl
)
synthesize_method
(
function
);
if
(
pedantic
&&
DECL_THIS_INLINE
(
function
)
&&
!
DECL_ARTIFICIAL
(
function
)
if
(
pedantic
&&
DECL_THIS_INLINE
(
function
)
&&
!
DECL_ARTIFICIAL
(
function
)
&&
!
DECL_INITIAL
(
function
)
&&
!
DECL_PENDING_INLINE_INFO
(
function
)
&&
!
DECL_INITIAL
(
function
)
&&
!
DECL_PENDING_INLINE_INFO
(
function
)
&&
!
(
DECL_TEMPLATE_INFO
(
function
)
&&
!
(
DECL_TEMPLATE_INFO
(
function
)
...
@@ -4157,48 +4151,27 @@ static void
...
@@ -4157,48 +4151,27 @@ static void
print_z_candidates
(
candidates
)
print_z_candidates
(
candidates
)
struct
z_candidate
*
candidates
;
struct
z_candidate
*
candidates
;
{
{
if
(
!
candidates
)
char
*
str
=
"candidates are:"
;
return
;
if
(
TREE_CODE
(
candidates
->
fn
)
==
IDENTIFIER_NODE
)
{
if
(
candidates
->
fn
==
ansi_opname
[
COND_EXPR
])
cp_error
(
"candidates are: %D(%T, %T, %T) <builtin>"
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
2
)));
else
if
(
TREE_VEC_LENGTH
(
candidates
->
convs
)
==
2
)
cp_error
(
"candidates are: %D(%T, %T) <builtin>"
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)));
else
cp_error
(
"candidates are: %D(%T) <builtin>"
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)));
}
else
cp_error_at
(
"candidates are: %D"
,
candidates
->
fn
);
candidates
=
candidates
->
next
;
for
(;
candidates
;
candidates
=
candidates
->
next
)
for
(;
candidates
;
candidates
=
candidates
->
next
)
{
{
if
(
TREE_CODE
(
candidates
->
fn
)
==
IDENTIFIER_NODE
)
if
(
TREE_CODE
(
candidates
->
fn
)
==
IDENTIFIER_NODE
)
{
{
if
(
candidates
->
fn
==
ansi_opname
[
COND_EXPR
])
if
(
candidates
->
fn
==
ansi_opname
[
COND_EXPR
])
cp_error
(
" %D(%T, %T, %T) <builtin>"
,
cp_error
(
"%s %D(%T, %T, %T) <builtin>"
,
str
,
candidates
->
fn
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
2
)));
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
2
)));
else
if
(
TREE_VEC_LENGTH
(
candidates
->
convs
)
==
2
)
else
if
(
TREE_VEC_LENGTH
(
candidates
->
convs
)
==
2
)
cp_error
(
"
%D(%T, %T) <builtin>"
,
candidates
->
fn
,
cp_error
(
"
%s %D(%T, %T) <builtin>"
,
str
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)),
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)));
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
1
)));
else
else
cp_error
(
"
%D(%T) <builtin>"
,
candidates
->
fn
,
cp_error
(
"
%s %D(%T) <builtin>"
,
str
,
candidates
->
fn
,
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)));
TREE_TYPE
(
TREE_VEC_ELT
(
candidates
->
convs
,
0
)));
}
}
else
else
cp_error_at
(
" %D"
,
candidates
->
fn
);
cp_error_at
(
"%s %+D"
,
str
,
candidates
->
fn
);
str
=
" "
;
}
}
}
}
...
@@ -4334,6 +4307,7 @@ build_new_function_call (fn, args, obj)
...
@@ -4334,6 +4307,7 @@ build_new_function_call (fn, args, obj)
if
(
obj
==
NULL_TREE
&&
TREE_CODE
(
fn
)
==
TREE_LIST
)
if
(
obj
==
NULL_TREE
&&
TREE_CODE
(
fn
)
==
TREE_LIST
)
{
{
tree
t
;
tree
t
;
tree
templates
=
NULL_TREE
;
for
(
t
=
args
;
t
;
t
=
TREE_CHAIN
(
t
))
for
(
t
=
args
;
t
;
t
=
TREE_CHAIN
(
t
))
if
(
TREE_VALUE
(
t
)
==
error_mark_node
)
if
(
TREE_VALUE
(
t
)
==
error_mark_node
)
...
@@ -4342,8 +4316,11 @@ build_new_function_call (fn, args, obj)
...
@@ -4342,8 +4316,11 @@ build_new_function_call (fn, args, obj)
for
(
t
=
TREE_VALUE
(
fn
);
t
;
t
=
DECL_CHAIN
(
t
))
for
(
t
=
TREE_VALUE
(
fn
);
t
;
t
=
DECL_CHAIN
(
t
))
{
{
if
(
TREE_CODE
(
t
)
==
TEMPLATE_DECL
)
if
(
TREE_CODE
(
t
)
==
TEMPLATE_DECL
)
candidates
=
add_template_candidate
{
(
candidates
,
t
,
args
,
LOOKUP_NORMAL
);
templates
=
decl_tree_cons
(
NULL_TREE
,
t
,
templates
);
candidates
=
add_template_candidate
(
candidates
,
t
,
args
,
LOOKUP_NORMAL
);
}
else
else
candidates
=
add_function_candidate
candidates
=
add_function_candidate
(
candidates
,
t
,
args
,
LOOKUP_NORMAL
);
(
candidates
,
t
,
args
,
LOOKUP_NORMAL
);
...
@@ -4369,6 +4346,12 @@ build_new_function_call (fn, args, obj)
...
@@ -4369,6 +4346,12 @@ build_new_function_call (fn, args, obj)
return
error_mark_node
;
return
error_mark_node
;
}
}
/* Pedantically, it is ill-formed to define a function that could
also be a template instantiation, but we won't implement that
until things settle down. */
if
(
templates
&&
!
cand
->
template
&&
!
DECL_INITIAL
(
cand
->
fn
))
add_maybe_template
(
cand
->
fn
,
templates
);
return
build_over_call
(
cand
->
fn
,
cand
->
convs
,
args
,
LOOKUP_NORMAL
);
return
build_over_call
(
cand
->
fn
,
cand
->
convs
,
args
,
LOOKUP_NORMAL
);
}
}
...
@@ -4482,6 +4465,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
...
@@ -4482,6 +4465,7 @@ build_new_op (code, flags, arg1, arg2, arg3)
struct
z_candidate
*
candidates
=
0
,
*
cand
;
struct
z_candidate
*
candidates
=
0
,
*
cand
;
tree
fns
,
mem_arglist
,
arglist
,
fnname
,
*
p
;
tree
fns
,
mem_arglist
,
arglist
,
fnname
,
*
p
;
enum
tree_code
code2
=
NOP_EXPR
;
enum
tree_code
code2
=
NOP_EXPR
;
tree
templates
=
NULL_TREE
;
if
(
arg1
==
error_mark_node
)
if
(
arg1
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
...
@@ -4602,7 +4586,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
...
@@ -4602,7 +4586,11 @@ build_new_op (code, flags, arg1, arg2, arg3)
for
(;
fns
;
fns
=
DECL_CHAIN
(
fns
))
for
(;
fns
;
fns
=
DECL_CHAIN
(
fns
))
{
{
if
(
TREE_CODE
(
fns
)
==
TEMPLATE_DECL
)
if
(
TREE_CODE
(
fns
)
==
TEMPLATE_DECL
)
candidates
=
add_template_candidate
(
candidates
,
fns
,
arglist
,
flags
);
{
templates
=
decl_tree_cons
(
NULL_TREE
,
fns
,
templates
);
candidates
=
add_template_candidate
(
candidates
,
fns
,
arglist
,
flags
);
}
else
else
candidates
=
add_function_candidate
(
candidates
,
fns
,
arglist
,
flags
);
candidates
=
add_function_candidate
(
candidates
,
fns
,
arglist
,
flags
);
}
}
...
@@ -4715,6 +4703,13 @@ build_new_op (code, flags, arg1, arg2, arg3)
...
@@ -4715,6 +4703,13 @@ build_new_op (code, flags, arg1, arg2, arg3)
if
(
DECL_FUNCTION_MEMBER_P
(
cand
->
fn
))
if
(
DECL_FUNCTION_MEMBER_P
(
cand
->
fn
))
enforce_access
(
cand
->
basetype_path
,
cand
->
fn
);
enforce_access
(
cand
->
basetype_path
,
cand
->
fn
);
/* Pedantically, it is ill-formed to define a function that could
also be a template instantiation, but we won't implement that
until things settle down. */
if
(
templates
&&
!
cand
->
template
&&
!
DECL_INITIAL
(
cand
->
fn
)
&&
TREE_CODE
(
TREE_TYPE
(
cand
->
fn
))
!=
METHOD_TYPE
)
add_maybe_template
(
cand
->
fn
,
templates
);
return
build_over_call
return
build_over_call
(
cand
->
fn
,
cand
->
convs
,
(
cand
->
fn
,
cand
->
convs
,
TREE_CODE
(
TREE_TYPE
(
cand
->
fn
))
==
METHOD_TYPE
TREE_CODE
(
TREE_TYPE
(
cand
->
fn
))
==
METHOD_TYPE
...
@@ -4999,12 +4994,6 @@ build_over_call (fn, convs, args, flags)
...
@@ -4999,12 +4994,6 @@ build_over_call (fn, convs, args, flags)
converted_args
=
nreverse
(
converted_args
);
converted_args
=
nreverse
(
converted_args
);
mark_used
(
fn
);
mark_used
(
fn
);
/* Is it a synthesized method that needs to be synthesized? */
if
(
DECL_ARTIFICIAL
(
fn
)
&&
!
DECL_INITIAL
(
fn
)
&&
DECL_CLASS_CONTEXT
(
fn
)
/* Kludge: don't synthesize for default args. */
&&
current_function_decl
)
synthesize_method
(
fn
);
if
(
pedantic
&&
DECL_THIS_INLINE
(
fn
)
&&
!
DECL_ARTIFICIAL
(
fn
)
if
(
pedantic
&&
DECL_THIS_INLINE
(
fn
)
&&
!
DECL_ARTIFICIAL
(
fn
)
&&
!
DECL_INITIAL
(
fn
)
&&
!
DECL_PENDING_INLINE_INFO
(
fn
)
&&
!
DECL_INITIAL
(
fn
)
&&
!
DECL_PENDING_INLINE_INFO
(
fn
)
...
...
gcc/cp/cp-tree.h
View file @
73aad9b9
...
@@ -1135,7 +1135,7 @@ struct lang_decl
...
@@ -1135,7 +1135,7 @@ struct lang_decl
#if 0 /* UNUSED */
#if 0 /* UNUSED */
/* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
/* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and
should be looked up in a non-standard way. */
should be looked up in a non-standard way. */
#define DECL_OVERLOADED(NODE) (
DECL_LANG_FLAG_4 (NODE)
)
#define DECL_OVERLOADED(NODE) (
FOO
)
#endif
#endif
/* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
/* Nonzero if this (non-TYPE)_DECL has its virtual attribute set.
...
@@ -1331,7 +1331,7 @@ extern int flag_new_for_scope;
...
@@ -1331,7 +1331,7 @@ extern int flag_new_for_scope;
/* Accessor macros for C++ template decl nodes. */
/* Accessor macros for C++ template decl nodes. */
#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE)
/* For class templates. */
/* For class templates. */
#define DECL_TEMPLATE_
MEMBER
S(NODE) DECL_SIZE(NODE)
#define DECL_TEMPLATE_
SPECIALIZATION
S(NODE) DECL_SIZE(NODE)
/* For function, method, class-data templates. */
/* For function, method, class-data templates. */
#define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
#define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE)
#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE)
...
@@ -1380,6 +1380,8 @@ extern int flag_new_for_scope;
...
@@ -1380,6 +1380,8 @@ extern int flag_new_for_scope;
#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
(CLASSTYPE_USE_TEMPLATE(NODE) = 3)
(CLASSTYPE_USE_TEMPLATE(NODE) = 3)
/* This function may be a guiding decl for a template. */
#define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
/* We know what we're doing with this decl now. */
/* We know what we're doing with this decl now. */
#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
...
@@ -2308,6 +2310,7 @@ extern tree instantiate_decl PROTO((tree));
...
@@ -2308,6 +2310,7 @@ extern tree instantiate_decl PROTO((tree));
extern
tree
classtype_mangled_name
PROTO
((
tree
));
extern
tree
classtype_mangled_name
PROTO
((
tree
));
extern
tree
lookup_nested_type_by_name
PROTO
((
tree
,
tree
));
extern
tree
lookup_nested_type_by_name
PROTO
((
tree
,
tree
));
extern
tree
do_poplevel
PROTO
((
void
));
extern
tree
do_poplevel
PROTO
((
void
));
extern
tree
*
get_bindings
PROTO
((
tree
,
tree
));
/* in search.c */
/* in search.c */
extern
void
push_memoized_context
PROTO
((
tree
,
int
));
extern
void
push_memoized_context
PROTO
((
tree
,
int
));
...
...
gcc/cp/decl.c
View file @
73aad9b9
...
@@ -2869,7 +2869,6 @@ duplicate_decls (newdecl, olddecl)
...
@@ -2869,7 +2869,6 @@ duplicate_decls (newdecl, olddecl)
if
(
TREE_CODE
(
newdecl
)
==
TEMPLATE_DECL
)
if
(
TREE_CODE
(
newdecl
)
==
TEMPLATE_DECL
)
{
{
DECL_TEMPLATE_MEMBERS
(
newdecl
)
=
DECL_TEMPLATE_MEMBERS
(
olddecl
);
DECL_TEMPLATE_INSTANTIATIONS
(
newdecl
)
DECL_TEMPLATE_INSTANTIATIONS
(
newdecl
)
=
DECL_TEMPLATE_INSTANTIATIONS
(
olddecl
);
=
DECL_TEMPLATE_INSTANTIATIONS
(
olddecl
);
if
(
DECL_CHAIN
(
newdecl
)
==
NULL_TREE
)
if
(
DECL_CHAIN
(
newdecl
)
==
NULL_TREE
)
...
@@ -5646,7 +5645,11 @@ shadow_tag (declspecs)
...
@@ -5646,7 +5645,11 @@ shadow_tag (declspecs)
{
{
if
(
CLASSTYPE_IMPLICIT_INSTANTIATION
(
value
)
if
(
CLASSTYPE_IMPLICIT_INSTANTIATION
(
value
)
&&
TYPE_SIZE
(
value
)
==
NULL_TREE
)
&&
TYPE_SIZE
(
value
)
==
NULL_TREE
)
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION
(
value
);
{
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION
(
value
);
if
(
current_template_parms
)
push_template_decl
(
TYPE_MAIN_DECL
(
value
));
}
else
if
(
CLASSTYPE_TEMPLATE_INSTANTIATION
(
value
))
else
if
(
CLASSTYPE_TEMPLATE_INSTANTIATION
(
value
))
cp_error
(
"specialization after instantiation of `%T'"
,
value
);
cp_error
(
"specialization after instantiation of `%T'"
,
value
);
}
}
...
...
gcc/cp/decl2.c
View file @
73aad9b9
...
@@ -498,11 +498,6 @@ lang_decode_option (p)
...
@@ -498,11 +498,6 @@ lang_decode_option (p)
flag_alt_external_templates
=
0
;
flag_alt_external_templates
=
0
;
found
=
1
;
found
=
1
;
}
}
else
if
(
!
strcmp
(
p
,
"ansi-overloading"
))
{
warning
(
"-fansi-overloading is no longer meaningful"
);
found
=
1
;
}
else
if
(
!
strcmp
(
p
,
"repo"
))
else
if
(
!
strcmp
(
p
,
"repo"
))
{
{
flag_use_repository
=
1
;
flag_use_repository
=
1
;
...
@@ -2876,6 +2871,7 @@ build_cleanup (decl)
...
@@ -2876,6 +2871,7 @@ build_cleanup (decl)
extern
int
parse_time
,
varconst_time
;
extern
int
parse_time
,
varconst_time
;
extern
tree
pending_templates
;
extern
tree
pending_templates
;
extern
tree
maybe_templates
;
#define TIMEVAR(VAR, BODY) \
#define TIMEVAR(VAR, BODY) \
do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
do { int otime = get_run_time (); BODY; VAR += get_run_time () - otime; } while (0)
...
@@ -2952,6 +2948,20 @@ finish_file ()
...
@@ -2952,6 +2948,20 @@ finish_file ()
instantiate_decl
(
decl
);
instantiate_decl
(
decl
);
}
}
for
(
fnname
=
maybe_templates
;
fnname
;
fnname
=
TREE_CHAIN
(
fnname
))
{
tree
*
args
,
fn
,
decl
=
TREE_VALUE
(
fnname
);
if
(
DECL_INITIAL
(
decl
))
continue
;
fn
=
TREE_PURPOSE
(
fnname
);
args
=
get_bindings
(
fn
,
decl
);
fn
=
instantiate_template
(
fn
,
args
);
free
(
args
);
instantiate_decl
(
fn
);
}
/* Push into C language context, because that's all
/* Push into C language context, because that's all
we'll need here. */
we'll need here. */
push_lang_context
(
lang_name_c
);
push_lang_context
(
lang_name_c
);
...
@@ -3848,6 +3858,12 @@ mark_used (decl)
...
@@ -3848,6 +3858,12 @@ mark_used (decl)
if
(
current_template_parms
)
if
(
current_template_parms
)
return
;
return
;
assemble_external
(
decl
);
assemble_external
(
decl
);
/* Is it a synthesized method that needs to be synthesized? */
if
(
TREE_CODE
(
decl
)
==
FUNCTION_DECL
&&
DECL_CLASS_CONTEXT
(
decl
)
&&
DECL_ARTIFICIAL
(
decl
)
&&
!
DECL_INITIAL
(
decl
)
/* Kludge: don't synthesize for default args. */
&&
current_function_decl
)
synthesize_method
(
decl
);
if
(
DECL_LANG_SPECIFIC
(
decl
)
&&
DECL_TEMPLATE_INFO
(
decl
))
if
(
DECL_LANG_SPECIFIC
(
decl
)
&&
DECL_TEMPLATE_INFO
(
decl
))
instantiate_decl
(
decl
);
instantiate_decl
(
decl
);
}
}
gcc/cp/errfn.c
View file @
73aad9b9
...
@@ -44,11 +44,12 @@ extern int cp_line_of PROTO((tree));
...
@@ -44,11 +44,12 @@ extern int cp_line_of PROTO((tree));
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
#define STRDUP(f) (ap = (char *) alloca (strlen (f) +1), strcpy (ap, (f)), ap)
#define NARGS 4
#define NARGS 5
#define arglist a1, a2, a3, a4
#define arglist a1, a2, a3, a4, a5
#define arglist_dcl HOST_WIDE_INT a1, a2, a3, a4;
#define arglist_dcl HOST_WIDE_INT a1, a2, a3, a4, a5;
#define ARGSINIT args[0] = a1; args[1] = a2; args[2] = a3; args[3] = a4;
#define ARGSINIT \
#define ARGSLIST args[0], args[1], args[2], args[3]
args[0] = a1; args[1] = a2; args[2] = a3; args[3] = a4; args[4] = a5;
#define ARGSLIST args[0], args[1], args[2], args[3], args[4]
static
void
static
void
cp_thing
(
errfn
,
atarg1
,
format
,
arglist
)
cp_thing
(
errfn
,
atarg1
,
format
,
arglist
)
...
...
gcc/cp/parse.y
View file @
73aad9b9
...
@@ -418,6 +418,8 @@ template_header:
...
@@ -418,6 +418,8 @@ template_header:
{ begin_template_parm_list (); }
{ begin_template_parm_list (); }
template_parm_list '>'
template_parm_list '>'
{ $$ = end_template_parm_list ($4); }
{ $$ = end_template_parm_list ($4); }
| TEMPLATE '<' '>'
{ $$ = NULL_TREE; }
;
;
template_parm_list:
template_parm_list:
...
@@ -2321,7 +2323,11 @@ named_class_head:
...
@@ -2321,7 +2323,11 @@ named_class_head:
{
{
if (CLASSTYPE_IMPLICIT_INSTANTIATION ($$)
if (CLASSTYPE_IMPLICIT_INSTANTIATION ($$)
&& TYPE_SIZE ($$) == NULL_TREE)
&& TYPE_SIZE ($$) == NULL_TREE)
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION ($$);
{
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION ($$);
if (current_template_parms)
push_template_decl (TYPE_MAIN_DECL ($$));
}
else if (CLASSTYPE_TEMPLATE_INSTANTIATION ($$))
else if (CLASSTYPE_TEMPLATE_INSTANTIATION ($$))
cp_error ("specialization after instantiation of `%T'", $$);
cp_error ("specialization after instantiation of `%T'", $$);
}
}
...
@@ -2525,7 +2531,11 @@ left_curly: '{'
...
@@ -2525,7 +2531,11 @@ left_curly: '{'
{
{
if (CLASSTYPE_IMPLICIT_INSTANTIATION (t)
if (CLASSTYPE_IMPLICIT_INSTANTIATION (t)
&& TYPE_SIZE (t) == NULL_TREE)
&& TYPE_SIZE (t) == NULL_TREE)
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t);
{
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t);
if (current_template_parms)
push_template_decl (TYPE_MAIN_DECL (t));
}
else if (CLASSTYPE_TEMPLATE_INSTANTIATION (t))
else if (CLASSTYPE_TEMPLATE_INSTANTIATION (t))
cp_error ("specialization after instantiation of `%T'", t);
cp_error ("specialization after instantiation of `%T'", t);
}
}
...
...
gcc/cp/pt.c
View file @
73aad9b9
This diff is collapsed.
Click to expand it.
gcc/cp/tree.c
View file @
73aad9b9
...
@@ -1772,8 +1772,21 @@ bot_manip (t)
...
@@ -1772,8 +1772,21 @@ bot_manip (t)
if
(
TREE_CODE
(
t
)
!=
TREE_LIST
&&
!
TREE_SIDE_EFFECTS
(
t
))
if
(
TREE_CODE
(
t
)
!=
TREE_LIST
&&
!
TREE_SIDE_EFFECTS
(
t
))
return
t
;
return
t
;
else
if
(
TREE_CODE
(
t
)
==
TARGET_EXPR
)
else
if
(
TREE_CODE
(
t
)
==
TARGET_EXPR
)
return
build_cplus_new
(
TREE_TYPE
(
t
),
{
break_out_target_exprs
(
TREE_OPERAND
(
t
,
1
)));
if
(
TREE_CODE
(
TREE_OPERAND
(
t
,
1
))
==
NEW_EXPR
)
{
mark_used
(
TREE_OPERAND
(
TREE_OPERAND
(
TREE_OPERAND
(
t
,
1
),
0
),
0
));
return
build_cplus_new
(
TREE_TYPE
(
t
),
break_out_target_exprs
(
TREE_OPERAND
(
t
,
1
)));
}
t
=
copy_node
(
t
);
TREE_OPERAND
(
t
,
0
)
=
build
(
VAR_DECL
,
TREE_TYPE
(
t
));
layout_decl
(
TREE_OPERAND
(
t
,
0
),
0
);
return
t
;
}
else
if
(
TREE_CODE
(
t
)
==
CALL_EXPR
)
mark_used
(
TREE_OPERAND
(
TREE_OPERAND
(
t
,
0
),
0
));
return
NULL_TREE
;
return
NULL_TREE
;
}
}
...
@@ -2078,3 +2091,17 @@ cp_tree_equal (t1, t2)
...
@@ -2078,3 +2091,17 @@ cp_tree_equal (t1, t2)
return
-
1
;
return
-
1
;
}
}
/* Similar to make_tree_vec, but build on a temporary obstack. */
tree
make_temp_vec
(
len
)
int
len
;
{
register
tree
node
;
push_obstacks_nochange
();
resume_temporary_allocation
();
node
=
make_tree_vec
(
len
);
pop_obstacks
();
return
node
;
}
gcc/cp/typeck.c
View file @
73aad9b9
...
@@ -2545,15 +2545,7 @@ build_function_call_real (function, params, require_complete, flags)
...
@@ -2545,15 +2545,7 @@ build_function_call_real (function, params, require_complete, flags)
needs to be separately compiled). */
needs to be separately compiled). */
if
(
DECL_INLINE
(
function
))
if
(
DECL_INLINE
(
function
))
{
function
=
inline_conversion
(
function
);
/* Is it a synthesized method that needs to be synthesized? */
if
(
DECL_ARTIFICIAL
(
function
)
&&
!
DECL_INITIAL
(
function
)
/* Kludge: don't synthesize for default args. */
&&
current_function_decl
)
synthesize_method
(
function
);
function
=
inline_conversion
(
function
);
}
else
else
function
=
build_addr_func
(
function
);
function
=
build_addr_func
(
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