Is pedantic safe to turn on? TIME TO FIND OUT.

This commit is contained in:
ThePhD 2016-04-02 09:11:44 -04:00
parent c087ca30bf
commit 5efbae5798
3 changed files with 2 additions and 3 deletions

View File

@ -55,7 +55,7 @@ args = parser.parse_args()
# general variables
include = [ '.', './include' ]
depends = [os.path.join('Catch', 'include')]
cxxflags = [ '-Wall', '-Wextra', '-pedantic', '-pedantic-errors', '-std=c++14', '-ftemplate-depth=1024' ]
cxxflags = [ '-Wall', '-Wextra', '-Wpedantic', '-pedantic', '-pedantic-errors', '-std=c++14', '-ftemplate-depth=1024' ]
cxxflags.extend([p for p in re.split("( |\\\".*?\\\"|'.*?')", args.cxx_flags) if p.strip()])
ldflags = []
script_dir = os.path.dirname(os.path.realpath(sys.argv[0]))

View File

@ -83,7 +83,6 @@ private:
}
protected_function_result invoke(types<>, std::index_sequence<>, std::ptrdiff_t n, handler& h) const {
bool handlerpushed = error_handler.valid();
int stacksize = lua_gettop(lua_state());
int firstreturn = std::max(1, stacksize - static_cast<int>(n) - 1);
int returncount = 0;

View File

@ -290,7 +290,7 @@ template<typename T, typename C>
struct checker<optional<T>, type::poly, C> {
template <typename Handler>
static bool check(lua_State* L, int index, Handler&& handler) {
return stack::check<T>(L, index, std::forward<Handler>(handler));
return stack::check<nil_t>(L, index, no_panic) || stack::check<T>(L, index, std::forward<Handler>(handler));
}
};
} // stack