Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ Directive::Directive(const simplecpp::Location & _loc, std::string _str) :
str(std::move(_str))
{}

Directive::Directive(std::string _file, const int _linenr, std::string _str) :
file(std::move(_file)),
linenr(_linenr),
str(std::move(_str))
{}

Directive::DirectiveToken::DirectiveToken(const simplecpp::Token & _tok) :
line(_tok.location.line),
column(_tok.location.col),
Expand Down
1 change: 0 additions & 1 deletion lib/preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ struct CPPCHECKLIB Directive {

/** record a directive (possibly filtering src) */
Directive(const simplecpp::Location & _loc, std::string _str);
Directive(std::string _file, int _linenr, std::string _str);
};

class CPPCHECKLIB RemarkComment {
Expand Down
5 changes: 4 additions & 1 deletion test/testunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,10 @@ class TestUnusedVar : public TestFixture {

void structmember15() { // #3088
std::list<Directive> directives;
directives.emplace_back("test.cpp", 1, "#pragma pack(1)");
std::vector<std::string> f = { "test.cpp" };
simplecpp::Location loc(f);
loc.line = 1;
directives.emplace_back(loc, "#pragma pack(1)");
checkStructMemberUsage("\nstruct Foo { int x; int y; };", dinit(CheckStructMemberUsageOptions, $.directives = &directives));
ASSERT_EQUALS("", errout_str());
}
Expand Down
Loading