Change "odd flag" criteria on preprocessor command flags (#57)

The assert on libclang/preprocessor.cpp:263 fails with common flags
such as "-g", because the assertion says valid flags must have at least
three characters.

I've changed that condition to accept two char flags like -g
This commit is contained in:
Manu Sánchez 2018-06-06 13:39:00 +02:00 committed by Jonathan Müller
commit c341ae01f1

View file

@ -226,8 +226,8 @@ namespace
// other flags
for (const auto& flag : detail::libclang_compile_config_access::flags(c))
{
DEBUG_ASSERT(flag.size() > 2u && flag[0] == '-', detail::assert_handler{},
"that's an odd flag");
DEBUG_ASSERT(flag.size() >= 2u && flag[0] == '-', detail::assert_handler{},
("\"" + flag + "\" that's an odd flag").c_str());
if (!macro_file_path || flag[1] != 'I')
{
// only add this flag if it is not an include or we're not doing fast preprocessing