repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
[official-gcc.git]
/
gcc
/
testsuite
/
gdc.test
/
fail_compilation
/
scope_class.d
blob
b5e1a54d71bbf5b14084589fdd0e8df51bf606c2
1
/*
2
TEST_OUTPUT:
3
---
4
fail_compilation/scope_class.d(12): Error: functions cannot return `scope scope_class.C`
5
---
6
*/
7
8
9
10
scope class
C
{
int
i
; }
// Notice the use of `scope` here
11
12
C
increment
(
C c
)
13
{
14
c
.
i
++;
15
return
c
;
16
}
17
18
void
main
()
19
{
20
scope
C c
=
new
C
();
21
c
.
increment
();
22
}