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
ac8cd718
Commit
ac8cd718
authored
Jan 05, 2000
by
Nathan Sidwell
Committed by
Nathan Sidwell
Jan 05, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* g++.old-deja/g++.other/cast4.C: New test.
From-SVN: r31237
parent
c0d2229e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
0 deletions
+67
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.old-deja/g++.other/cast4.C
+63
-0
No files found.
gcc/testsuite/ChangeLog
View file @
ac8cd718
2000-01-05 Nathan Sidwell <nathan@acm.org>
* g++.old-deja/g++.other/cast4.C: New test.
Wed Jan 5 00:26:20 2000 Jeffrey A Law (law@cygnus.com)
* gcc.c-torture/compile/20000105-2.c: New test.
...
...
gcc/testsuite/g++.old-deja/g++.other/cast4.C
0 → 100644
View file @
ac8cd718
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 3 Jan 2000 <nathan@acm.org>
// Derived from a bug report by Ulrich Drepper <drepper@cygnus.com>
struct
A
{
operator
char
*
()
{
return
0
;}
};
struct
B
{
operator
char
*
()
const
{
return
0
;}
};
struct
C
{
operator
char
const
*
()
{
return
0
;}
};
struct
D
{
operator
char
const
*
()
const
{
return
0
;}
};
void
f0
()
{
A
a
=
A
();
B
b
=
B
();
C
c
=
C
();
D
d
=
D
();
static_cast
<
char
*>
(
a
);
static_cast
<
char
*>
(
b
);
static_cast
<
char
*>
(
c
);
// ERROR - static cast
static_cast
<
char
*>
(
d
);
// ERROR - static cast
}
void
f1
()
{
A
a
=
A
();
B
b
=
B
();
C
c
=
C
();
D
d
=
D
();
static_cast
<
const
char
*>
(
a
);
static_cast
<
const
char
*>
(
b
);
static_cast
<
const
char
*>
(
c
);
static_cast
<
const
char
*>
(
d
);
}
void
f2
()
{
A
const
a
=
A
();
B
const
b
=
B
();
C
const
c
=
C
();
D
const
d
=
D
();
static_cast
<
char
*>
(
a
);
// ERROR - static cast
static_cast
<
char
*>
(
b
);
static_cast
<
char
*>
(
c
);
// ERROR - static cast
static_cast
<
char
*>
(
d
);
// ERROR - static cast
}
void
f3
()
{
A
const
a
=
A
();
B
const
b
=
B
();
C
const
c
=
C
();
D
const
d
=
D
();
static_cast
<
const
char
*>
(
a
);
// ERROR - static cast
static_cast
<
const
char
*>
(
b
);
static_cast
<
const
char
*>
(
c
);
// ERROR - static cast
static_cast
<
const
char
*>
(
d
);
}
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