Skip to content

Commit 66bf2b0

Browse files
committed
Add test for anonymous struct containing an implicitly private data member.
Patch by Jacob Young! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300266 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 18974a9 commit 66bf2b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/SemaCXX/anonymous-struct.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ struct E {
2121
};
2222
static struct {
2323
};
24+
class {
25+
int anon_priv_field; // expected-error {{anonymous struct cannot contain a private data member}}
26+
};
2427
};
2528

2629
template <class T> void foo(T);

0 commit comments

Comments
 (0)