Compile clean with -Werror
This commit is contained in:
commit
63c34e1ca3
4 changed files with 9 additions and 5 deletions
|
|
@ -57,6 +57,6 @@ install:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- mkdir build/ && cd build/
|
- mkdir build/ && cd build/
|
||||||
- $CMAKE -DCMAKE_CXX_FLAGS="-pedantic -Wall -Wextra -Wconversion -Wsign-conversion -Wno-parentheses" -DLLVM_DOWNLOAD_OS_NAME=$LLVM_DOWNLOAD_OS_NAME -DLLVM_PREFERRED_VERSION=$LLVM_VERSION ../
|
- $CMAKE -DCMAKE_CXX_FLAGS="-Werror -pedantic -Wall -Wextra -Wconversion -Wsign-conversion -Wno-parentheses" -DLLVM_DOWNLOAD_OS_NAME=$LLVM_DOWNLOAD_OS_NAME -DLLVM_PREFERRED_VERSION=$LLVM_VERSION ../
|
||||||
- $CMAKE --build .
|
- $CMAKE --build .
|
||||||
- ./test/cppast_test
|
- ./test/cppast_test
|
||||||
|
|
|
||||||
2
external/tiny-process-library
vendored
2
external/tiny-process-library
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7539bc3f0c23104accc09f5c024d6b3609f0debe
|
Subproject commit 50f69197c2af03dc93cd0985a39d6809c80a27b5
|
||||||
|
|
@ -30,7 +30,11 @@ namespace
|
||||||
{
|
{
|
||||||
unsigned offset;
|
unsigned offset;
|
||||||
clang_getSpellingLocation(loc, nullptr, nullptr, nullptr, &offset);
|
clang_getSpellingLocation(loc, nullptr, nullptr, nullptr, &offset);
|
||||||
return clang_getLocationForOffset(tu, file, offset + inc);
|
if (inc >= 0)
|
||||||
|
offset += unsigned(inc);
|
||||||
|
else
|
||||||
|
offset -= unsigned(-inc);
|
||||||
|
return clang_getLocationForOffset(tu, file, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
class simple_tokenizer
|
class simple_tokenizer
|
||||||
|
|
@ -312,7 +316,7 @@ detail::token_iterator detail::find_closing_bracket(detail::token_stream stream)
|
||||||
--bracket_count;
|
--bracket_count;
|
||||||
else if (paren_count == 0 && template_bracket && cur == ">>")
|
else if (paren_count == 0 && template_bracket && cur == ">>")
|
||||||
// maximal munch
|
// maximal munch
|
||||||
bracket_count -= 2u;
|
bracket_count -= 2;
|
||||||
else if (cur == "(" || cur == "{" || cur == "[")
|
else if (cur == "(" || cur == "{" || cur == "[")
|
||||||
++paren_count;
|
++paren_count;
|
||||||
else if (cur == ")" || cur == "}" || cur == "]")
|
else if (cur == ")" || cur == "}" || cur == "]")
|
||||||
|
|
|
||||||
|
|
@ -288,7 +288,7 @@ int main(int argc, char* argv[])
|
||||||
logger.set_verbose(true);
|
logger.set_verbose(true);
|
||||||
|
|
||||||
auto file = parse_file(config, logger, options["file"].as<std::string>(),
|
auto file = parse_file(config, logger, options["file"].as<std::string>(),
|
||||||
options.count("fatal_errors") == 1u);
|
options.count("fatal_errors") == 1);
|
||||||
if (!file)
|
if (!file)
|
||||||
return 2;
|
return 2;
|
||||||
print_ast(std::cout, *file);
|
print_ast(std::cout, *file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue