[cfe-dev] Fiddling the Rewriter tests (anyone still care about Objective-C/C++?)
Nat! via cfe-dev
cfe-dev at lists.llvm.org
Thu Dec 8 01:31:06 PST 2016
Robinson, Paul via cfe-dev schrieb:
> Privately, we set the default C++ dialect to C++11. This causes all
> kinds of fun with the Clang tests, and Charles Li has been doing a lot
> of work to make the tests able to tolerate C++11. I'm helping out a
> little bit.
>
> Specifically I'm looking at the Rewriter tests. It looks like these
> take Objective-C/C++ input, generate a non-Objective equivalent, and
> then compile the resulting C++ to make sure it's clean. There are
> 32 tests that fail in the "compile the resulting C++" stage, when we
> set the default dialect to C++11.
>
> I'm guessing that Objective-C/C++ is kind of passe, so nobody is really
> interested in modernizing it (or the C++ that the rewriter produces).
> Therefore I'm proposing to simply add '-std=gnu++98' to the failing tests,
> and be done with it.
>
> Anybody mind if I do this?
> Thanks,
> --paulr
>
Hi Paul
If you look at "lib/Frontend/CompilerInvocation.cpp#1531" or so, you
will see that the language set for most ObjC runtimes is gnu++98.
case IK_CXX:
case IK_PreprocessedCXX:
case IK_ObjCXX:
case IK_PreprocessedObjCXX:
LangStd = LangStandard::lang_gnucxx98;
break;
So if the test somehow ignore this, then -std=gnu++98' sounds sensible
to me. Hope this helps. I myself have never used the Rewriter.
Ciao
Nat!
More information about the cfe-dev
mailing list