Skip to content

Commit

Permalink
Merge pull request #191 from rpopescu/master
Browse files Browse the repository at this point in the history
fixed #190 Argument shadowing and Clang pedantic support
  • Loading branch information
vitaut committed Aug 4, 2015
2 parents 5b8d0a7 + 0affb23 commit f9813c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ if (FMT_PEDANTIC AND CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(cppformat PROPERTIES COMPILE_FLAGS
"-Wall -Wextra -Wshadow -pedantic")
endif ()
if (FMT_PEDANTIC AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -pedantic")
endif ()

# If FMT_PEDANTIC is TRUE, then test compilation with both -std=c++11
# and the default flags. Otherwise use only the default flags.
Expand Down
4 changes: 2 additions & 2 deletions format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ int safe_strerror(
}

public:
StrError(int error_code, char *&buffer, std::size_t buffer_size)
: error_code_(error_code), buffer_(buffer), buffer_size_(buffer_size) {}
StrError(int err_code, char *&buf, std::size_t buf_size)
: error_code_(err_code), buffer_(buf), buffer_size_(buf_size) {}

int run() {
strerror_r(0, 0, ""); // Suppress a warning about unused strerror_r.
Expand Down
4 changes: 2 additions & 2 deletions format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,8 @@ struct NamedArg : Arg {
BasicStringRef<Char> name;

template <typename T>
NamedArg(BasicStringRef<Char> name, const T &value)
: name(name), Arg(MakeValue<Char>(value)) {
NamedArg(BasicStringRef<Char> argname, const T &value)
: name(argname), Arg(MakeValue<Char>(value)) {
type = static_cast<internal::Arg::Type>(MakeValue<Char>::type(value));
}
};
Expand Down

0 comments on commit f9813c3

Please sign in to comment.