The UnknownPragmaHandlers added by t`DoPrintPreprocessedInput` conflict with the real PragmaHandlers from clang::Parser because they try to handle the same #pragma directives. This makes it impossible to use a Preprocessor (that was previously passed to DoPrintPreprocessedInput), as an Preprocessor for a clang::Parser instance which is what we currently do in cling. This patch removes the added UnknownPragmaHandler to avoid conflicts these conflicts and leave the PragmaHandlers of the Preprocessors in a the same state as before calling DoPrintPreprocessedInput.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Please move the =new out of the PP.AddPragmaHandler calls.
While at it, this code still (as the original) leaks the PragmaHandlers. These should be deleted after RemovePragmaHandler or instead, simply use std::unique_ptr.
Comment Actions
Yaron, I can take care of this. Thanks for asking. Raphael and I are working together.