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
f915e937
Commit
f915e937
authored
Apr 27, 1999
by
Nathan Sidwell
Committed by
Nathan Sidwell
Apr 27, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* rtti.c (build_x_typeid): Check rtti is enabled.
From-SVN: r26675
parent
0118fd7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletions
+26
-1
gcc/cp/ChangeLog
+4
-0
gcc/cp/rtti.c
+8
-1
gcc/testsuite/g++.old-deja/g++.other/rtti5.C
+14
-0
No files found.
gcc/cp/ChangeLog
View file @
f915e937
1999-04-27 Nathan Sidwell <nathan@acm.org>
* rtti.c (build_x_typeid): Check rtti is enabled.
1999-04-26 Mark Mitchell <mark@codesourcery.com>
1999-04-26 Mark Mitchell <mark@codesourcery.com>
* search.c (is_subobject_of_p): Make sure we're looking at the
* search.c (is_subobject_of_p): Make sure we're looking at the
...
...
gcc/cp/rtti.c
View file @
f915e937
...
@@ -261,9 +261,15 @@ build_x_typeid (exp)
...
@@ -261,9 +261,15 @@ build_x_typeid (exp)
tree
exp
;
tree
exp
;
{
{
tree
cond
=
NULL_TREE
;
tree
cond
=
NULL_TREE
;
tree
type
=
TREE_TYPE
(
tinfo_fn_type
)
;
tree
type
;
int
nonnull
;
int
nonnull
;
if
(
!
flag_rtti
)
{
error
(
"cannot use typeid with -fno-rtti"
);
return
error_mark_node
;
}
if
(
TYPE_SIZE
(
type_info_type_node
)
==
NULL_TREE
)
if
(
TYPE_SIZE
(
type_info_type_node
)
==
NULL_TREE
)
{
{
error
(
"must #include <typeinfo> before using typeid"
);
error
(
"must #include <typeinfo> before using typeid"
);
...
@@ -288,6 +294,7 @@ build_x_typeid (exp)
...
@@ -288,6 +294,7 @@ build_x_typeid (exp)
if
(
exp
==
error_mark_node
)
if
(
exp
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
type
=
TREE_TYPE
(
tinfo_fn_type
);
exp
=
build_call
(
exp
,
type
,
NULL_TREE
);
exp
=
build_call
(
exp
,
type
,
NULL_TREE
);
if
(
cond
)
if
(
cond
)
...
...
gcc/testsuite/g++.old-deja/g++.other/rtti5.C
0 → 100644
View file @
f915e937
// Build don't link:
// Special g++ Options: -fno-rtti
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Apr 1999 <nathan@acm.org>
// derrived from bug report from Alexander Zvyagin <zvyagin@mx.ihep.su>
// check we don't die with disabled rtti
int
main
(
void
)
{
int
i
;
typeid
(
i
);
// ERROR - rtti disabled
}
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