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
2017-02-17 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.bob
/
inherit1.C
blob
c037a1c0b2d21b76689f3fba94f4cd1291423403
1
// { dg-do assemble }
2
class A {
3
char str[10];
4
public:
5
char* m1 () { return str;}
6
};
7
8
class C : public A {
9
public:
10
};
11
12
class B : public A {
13
public:
14
char* m1 () { C::m1(); return ""; } // { dg-error "cannot call" }
15
// { dg-warning "deprecated|forbids converting a string constant" "depr" { target *-*-* } 14 }
16
};
17
18
int main () {
19
A a;
20
B b;
21
C c;
22
23
a.m1();
24
c.m1();
25
b.m1();
26
}