Skip to content

Commit c69e2f4

Browse files
committed
mitigated misc-explicit-constructor clang-tidy warnings
1 parent 3672fd4 commit c69e2f4

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

simplecpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ namespace simplecpp {
16991699
};
17001700

17011701
struct invalidDirectiveAsMacroParameter : public Error {
1702-
invalidDirectiveAsMacroParameter(const Location &loc)
1702+
explicit invalidDirectiveAsMacroParameter(const Location &loc)
17031703
: Error(loc, "it is invalid to use a preprocessor directive as macro parameter") {}
17041704
};
17051705

simplecpp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ namespace simplecpp {
7575
struct View
7676
{
7777
// cppcheck-suppress noExplicitConstructor
78+
// NOLINTNEXTLINE(misc-explicit-constructor)
7879
View(const char* data)
7980
: mData(data)
8081
, mSize(strlen(data))
@@ -88,6 +89,7 @@ namespace simplecpp {
8889
{}
8990

9091
// cppcheck-suppress noExplicitConstructor
92+
// NOLINTNEXTLINE(misc-explicit-constructor)
9193
View(const std::string& str)
9294
: mData(str.data())
9395
, mSize(str.size())

0 commit comments

Comments
 (0)