Fixed C++11 bulid errors

This commit is contained in:
yhirose 2020-01-24 21:32:54 -05:00
parent e7b4570841
commit 13b8a46e90
3 changed files with 12 additions and 8 deletions

View File

@ -2530,9 +2530,11 @@ inline void DetectLeftRecursion::visit(Reference& ope) {
}
inline void HasEmptyElement::visit(Reference& ope) {
auto it = std::find_if(refs_.begin(), refs_.end(), [&](const auto& ref) {
return ope.name_ == ref.second;
});
auto it = std::find_if(refs_.begin(), refs_.end(),
[&](const std::pair<const char*, std::string>& ref) {
return ope.name_ == ref.second;
}
);
if (it != refs_.end()) {
return;
}
@ -2545,9 +2547,11 @@ inline void HasEmptyElement::visit(Reference& ope) {
}
inline void DetectInfiniteLoop::visit(Reference& ope) {
auto it = std::find_if(refs_.begin(), refs_.end(), [&](const auto& ref) {
return ope.name_ == ref.second;
});
auto it = std::find_if(refs_.begin(), refs_.end(),
[&](const std::pair<const char*, std::string>& ref) {
return ope.name_ == ref.second;
}
);
if (it != refs_.end()) {
return;
}

View File

@ -1,2 +1,2 @@
pl0: pl0.cc ../peglib.h
clang++ -std=c++14 -g -O0 pl0.cc `llvm-config --cxxflags --ldflags --system-libs --libs` -I.. -o pl0
clang++ -std=c++11 -g -O0 pl0.cc `llvm-config --cxxflags --ldflags --system-libs --libs` -I.. -o pl0

View File

@ -1,7 +1,7 @@
//
// pl0.cc - PL/0 language (https://en.wikipedia.org/wiki/PL/0)
//
// Copyright (c) 2018 Yuji Hirose. All rights reserved.
// Copyright (c) 2020 Yuji Hirose. All rights reserved.
// MIT License
//