ASSERT_EQUALS("[test.cpp:1:1]: (information) The code 'class x y {' is not handled. You can use -I or --include to add handling of this code. [class_X_Y]\n", errout_str());
}
}
voidwrong_syntax_anonymous_struct() {
ASSERT_THROW_INTERNAL(checkCode("struct { int x; } = {0};"), SYNTAX);
ASSERT_THROW_INTERNAL(checkCode("struct { int x; } * = {0};"), SYNTAX);
ASSERT_THROW_INTERNAL(checkCode("{ } x x ; { } h h [ ] ( ) ( ) { struct x ( x ) ; int __attribute__ ( ) f ( ) { h - > first = & x ; struct x * n = h - > first ; ( ) n > } }"), SYNTAX); // do not crash
ASSERT_THROW_INTERNAL(checkCode("A template < int { int = -1 ; } template < int N > struct B { int [ A < N > :: zero ] ; } ; B < 0 > b ;"), UNKNOWN_MACRO);
}
voidgarbageCode116() { // #5356
ASSERT_THROW_INTERNAL(checkCode("struct template<int { = }; > struct B { }; B < 0 > b;"), SYNTAX);
}
voidgarbageCode117() { // #6121
TODO_ASSERT_THROW(checkCode("enum E { f = {} };\n"
"int a = f;"), InternalError);
}
voidgarbageCode118() { // #5600 - missing include causes invalid enum
ignore_errout(); // we do not care about the output
}
voidgarbageCode123() {
(void)checkCode("namespace pr16989 {\n"
" class C {\n"
" C tpl_mem(T *) { return }\n"
" };\n"
"}");
ignore_errout(); // we do not care about the output
}
voidgarbageCode125() {
ASSERT_THROW_INTERNAL(checkCode("{ T struct B : T valueA_AA ; } T : [ T > ( ) { B } template < T > struct A < > : ] { ( ) { return valueA_AC struct { : } } b A < int > AC ( ) a_aa.M ; ( ) ( ) }"), SYNTAX);
ASSERT_THROW_INTERNAL(checkCode("template < Types > struct S :{ ( S < ) S >} { ( ) { } } ( ) { return S < void > ( ) }"),