Remove comments in macro invocations
Just breaks to much.
This commit is contained in:
parent
1b468ea476
commit
b3885bbb68
2 changed files with 9 additions and 12 deletions
|
|
@ -36,9 +36,9 @@ namespace
|
||||||
// -x c++: force C++ as input language
|
// -x c++: force C++ as input language
|
||||||
// -I.: add current working directory to include search path
|
// -I.: add current working directory to include search path
|
||||||
// -E: print preprocessor output
|
// -E: print preprocessor output
|
||||||
// -CC: keep comments, even in macro
|
// -C: keep comments
|
||||||
// -dD: print macro definitions as well
|
// -dD: print macro definitions as well
|
||||||
auto flags = std::string("-x c++ -I. -E -CC -dD");
|
auto flags = std::string("-x c++ -I. -E -C -dD");
|
||||||
if (detail::libclang_compile_config_access::clang_version(c) >= 40000)
|
if (detail::libclang_compile_config_access::clang_version(c) >= 40000)
|
||||||
// -Xclang -dI: print include directives as well (clang >= 4.0.0)
|
// -Xclang -dI: print include directives as well (clang >= 4.0.0)
|
||||||
flags += " -Xclang -dI";
|
flags += " -Xclang -dI";
|
||||||
|
|
@ -735,7 +735,7 @@ detail::preprocessor_output detail::preprocess(const libclang_compile_config& co
|
||||||
{
|
{
|
||||||
case linemarker::line_directive:
|
case linemarker::line_directive:
|
||||||
break; // ignore
|
break; // ignore
|
||||||
// no need to handle it, preprocessed output doesn't need to match line numbers precisely
|
// no need to handle it, preprocessed output doesn't need to match line numbers precisely
|
||||||
|
|
||||||
case linemarker::enter_new:
|
case linemarker::enter_new:
|
||||||
if (file_depth == 0u && lm.value().file.front() != '<')
|
if (file_depth == 0u && lm.value().file.front() != '<')
|
||||||
|
|
|
||||||
|
|
@ -173,23 +173,20 @@ f **/
|
||||||
#define g(name) \
|
#define g(name) \
|
||||||
class name \
|
class name \
|
||||||
{ \
|
{ \
|
||||||
/** i
|
|
||||||
i */ \
|
|
||||||
void i(); \
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// h
|
/// h
|
||||||
/// h
|
/// h
|
||||||
g(h)
|
g(h)
|
||||||
|
|
||||||
/// j
|
/// i
|
||||||
/// j
|
/// i
|
||||||
using j = int;
|
using i = int;
|
||||||
|
|
||||||
/// k
|
/// j
|
||||||
/// k
|
/// j
|
||||||
template <typename T/**/>
|
template <typename T/**/>
|
||||||
void k();
|
void j();
|
||||||
)";
|
)";
|
||||||
|
|
||||||
auto file = parse({}, "comment-matching.cpp", code);
|
auto file = parse({}, "comment-matching.cpp", code);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue