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
60f06d2f
Commit
60f06d2f
authored
May 24, 1998
by
Jason Merrill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
From-SVN: r20021
parent
f0983958
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
+82
-0
gcc/testsuite/g++.old-deja/g++.other/delete1.C
+15
-0
gcc/testsuite/g++.old-deja/g++.other/virtual1.C
+13
-0
gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C
+54
-0
No files found.
gcc/testsuite/g++.old-deja/g++.other/delete1.C
0 → 100644
View file @
60f06d2f
//Build don't link:
struct
cl_heap_ring
{
void
operator
delete
(
void
*
ptr
)
{
}
cl_heap_ring
()
{
}
};
struct
cl_heap_null_ring
:
public
cl_heap_ring
{
void
operator
delete
(
void
*
ptr
)
{
}
};
void
f
()
{
new
cl_heap_null_ring
();
}
gcc/testsuite/g++.old-deja/g++.other/virtual1.C
0 → 100644
View file @
60f06d2f
// Build don't link:
struct
S0
{
virtual
void
f1
()
{
}
};
struct
S1
:
virtual
public
S0
{
virtual
void
f1
()
{
}
};
struct
S2
:
public
S1
{
virtual
void
f1
()
{
}
};
struct
S3
:
virtual
public
S0
{
virtual
void
f1
()
{
}
};
struct
S4
:
public
S3
{
};
void
creator
()
{
new
S4
;
}
gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C
0 → 100644
View file @
60f06d2f
template
<
typename
Y
>
struct
auto_ptr_ref
{
Y
*
py
;
auto_ptr_ref
(
Y
*
p
)
:
py
(
p
)
{}
};
template
<
typename
X
>
struct
auto_ptr
{
X
*
px
;
public
:
typedef
X
element_type
;
explicit
auto_ptr
(
X
*
p
=
0
)
throw
()
:
px
(
p
)
{}
auto_ptr
(
auto_ptr
&
r
)
throw
()
:
px
(
r
.
release
())
{}
template
<
typename
Y
>
auto_ptr
(
auto_ptr
<
Y
>&
r
)
throw
()
:
px
(
r
.
release
())
{}
auto_ptr
&
operator
=
(
auto_ptr
&
r
)
throw
()
{
reset
(
r
.
release
());
return
*
this
;
}
template
<
typename
Y
>
auto_ptr
&
operator
=
(
auto_ptr
<
Y
>&
r
)
throw
()
{
reset
(
r
.
release
());
return
*
this
;
}
~
auto_ptr
()
{
delete
px
;
}
X
&
operator
*
()
const
throw
()
{
return
*
px
;
}
X
*
operator
->
()
const
throw
()
{
return
px
;
}
X
*
get
()
const
throw
()
{
return
px
;
}
X
*
release
()
throw
()
{
X
*
p
=
px
;
px
=
0
;
return
p
;
}
void
reset
(
X
*
p
=
0
)
throw
()
{
if
(
px
!=
p
)
delete
px
,
px
=
p
;
}
auto_ptr
(
auto_ptr_ref
<
X
>
r
)
throw
()
:
px
(
r
.
py
)
{}
template
<
typename
Y
>
operator
auto_ptr_ref
<
Y
>
()
throw
()
{
return
auto_ptr_ref
<
Y
>
(
release
());
}
template
<
typename
Y
>
operator
auto_ptr
<
Y
>
()
throw
()
{
return
auto_ptr
<
Y
>
(
release
());
}
};
struct
Base
{
Base
()
{}
virtual
~
Base
()
{}
};
struct
Derived
:
Base
{
Derived
()
{};
};
auto_ptr
<
Derived
>
f
()
{
auto_ptr
<
Derived
>
null
(
0
);
return
null
;
}
void
g
(
auto_ptr
<
Derived
>
)
{
}
void
h
(
auto_ptr
<
Base
>
)
{
}
int
main
()
{
auto_ptr
<
Base
>
x
(
f
());
auto_ptr
<
Derived
>
y
(
f
());
x
=
y
;
g
(
f
());
h
(
f
());
}
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