// RUN: cat %s | %cling -Xclang -verify -I%p | FileCheck %s // XFAIL: * // Test the ability of including a wrong file see diagnostics and remove the // cached files so that all the changes are going to be seen next time it gets // included. #include #include std::ofstream myfile; myfile.open("TmpClassDef.h"); myfile << "class MyClass{};\n" myfile << "error_here;"; myfile << "// expected-error {{C++ requires a type specifier for all declarations}}\n" myfile.close(); #include "TmpClassDef.h" myfile.open("TmpClassDef.h"); myfile << "class MyClass{ \n"; myfile << "public: \n"; myfile << " int gimme12(){\n"; myfile << " return 12;\n" myfile << " }\n" myfile << "};\n"; myfile.close(); #include "TmpClassDef.h" MyClass my; my.gimme12() // CHECK: (int const) 12