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
980c394c
Commit
980c394c
authored
Jun 04, 1999
by
Nathan Sidwell
Committed by
Nathan Sidwell
Jun 04, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* except.c (build_throw): Check throw expression validity.
From-SVN: r27344
parent
4469640c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
7 deletions
+40
-7
gcc/cp/ChangeLog
+4
-0
gcc/cp/except.c
+24
-0
gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C
+1
-1
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C
+4
-2
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C
+1
-1
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C
+2
-1
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C
+2
-1
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C
+2
-1
No files found.
gcc/cp/ChangeLog
View file @
980c394c
1999-06-04 Nathan Sidwell <nathan@acm.org>
* except.c (build_throw): Check throw expression validity.
1999-06-03 Mark Mitchell <mark@codesourcery.com>
* decl.c (grokdeclarator): Don't treat arbitrary types as unsigned
...
...
gcc/cp/except.c
View file @
980c394c
...
...
@@ -1152,6 +1152,30 @@ build_throw (e)
if
(
e
==
null_node
)
cp_warning
(
"throwing NULL, which has integral, not pointer type"
);
if
(
e
!=
NULL_TREE
)
{
tree
core
;
int
is_ptr
;
/* Cannot throw an incomplete type. */
e
=
require_complete_type
(
e
);
if
(
e
==
error_mark_node
)
return
e
;
/* Or a pointer or ref to one, other than cv void *. */
core
=
TREE_TYPE
(
e
);
is_ptr
=
TREE_CODE
(
core
)
==
POINTER_TYPE
;
if
(
is_ptr
||
TREE_CODE
(
core
)
==
REFERENCE_TYPE
)
{
core
=
TREE_TYPE
(
core
);
if
(
is_ptr
&&
same_type_p
(
TYPE_MAIN_VARIANT
(
core
),
void_type_node
))
/* OK */
;
else
if
(
!
complete_type_or_else
(
core
,
NULL_TREE
))
return
error_mark_node
;
}
}
e
=
build1
(
THROW_EXPR
,
void_type_node
,
e
);
TREE_SIDE_EFFECTS
(
e
)
=
1
;
...
...
gcc/testsuite/g++.old-deja/g++.robertl/eh990323-1.C
View file @
980c394c
...
...
@@ -17,7 +17,7 @@ template <class T> void ff(T)
{
}
void
g
(
void
)
void
g
(
int
)
{
}
...
...
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C
View file @
980c394c
// Build don't link:
//test 2
struct
A
{};
void
f
()
{
struct
A
;
throw
*
(
new
A
);
struct
A
;
// ERROR - forward ref
throw
*
(
new
A
);
// ERROR - invalid use of undefined type
}
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-2.C
View file @
980c394c
...
...
@@ -25,7 +25,7 @@ void f4()
throw
A
<
double
,
47
,
A
<
int
,
36
,
short
>
>
(
"hi michey"
);
}
main
()
int
main
()
{
int
flag
;
...
...
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C
View file @
980c394c
// Build don't link:
// try throwing overloaded function
void
f
(
int
)
...
...
@@ -10,5 +11,5 @@ void f(long)
void
g
()
{
throw
&
f
;
throw
&
f
;
// ERROR - insufficient contextual information
}
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C
View file @
980c394c
// Build don't link:
// try throwing template function name
template
<
class
T
>
void
f
(
T
);
...
...
@@ -8,5 +9,5 @@ template <class T> void f(T)
void
g
()
{
throw
&
f
;
throw
&
f
;
// ERROR - insufficient contextual information
}
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C
View file @
980c394c
// Build don't link:
// check attempting to throw an overloaded function
struct
A
{
...
...
@@ -7,5 +8,5 @@ struct A {
void
g
()
{
throw
&
A
::
f
;
throw
&
A
::
f
;
// ERROR - insufficient context
}
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