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
c++: robustify testcase [PR109752]
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
template
/
access34.C
blob
ec79f87e624858406a0719d159748f96d4085190
1
// PR c++/58993
2
// { dg-do compile }
3
4
class base { void foo(); };
5
6
template <class T>
7
struct bar : public base {
8
void f1() {
9
&base::foo; // { dg-error "private" }
10
}
11
12
template <class>
13
void f2() {
14
&base::foo; // { dg-error "private" }
15
}
16
17
void f3();
18
};
19
20
template <class T>
21
void bar<T>::f3() {
22
(void) &base::foo; // { dg-error "private" }
23
}
24
25
int main() {
26
bar<int>().f1();
27
bar<int>().f2<int>();
28
bar<int>().f3();
29
}