@@ -870,7 +870,7 @@ bool Preprocessor::reportOutput(const simplecpp::OutputList &outputList, bool sh
870870 const std::string::size_type pos1 = out.msg .find_first_of (" <\" " );
871871 const std::string::size_type pos2 = out.msg .find_first_of (" >\" " , pos1 + 1U );
872872 if (pos1 < pos2 && pos2 != std::string::npos)
873- missingInclude (out.location .file (), out.location .line , out.msg .substr (pos1+1 , pos2-pos1-1 ), out.msg [pos1] == ' \" ' ? UserHeader : SystemHeader);
873+ missingInclude (out.location .file (), out.location .line , out.location . col , out. msg .substr (pos1+1 , pos2-pos1-1 ), out.msg [pos1] == ' \" ' ? UserHeader : SystemHeader);
874874 }
875875 break ;
876876 case simplecpp::Output::INCLUDE_NESTED_TOO_DEEPLY:
@@ -910,14 +910,14 @@ void Preprocessor::error(const std::string &filename, unsigned int linenr, const
910910}
911911
912912// Report that include is missing
913- void Preprocessor::missingInclude (const std::string &filename, unsigned int linenr, const std::string &header, HeaderTypes headerType)
913+ void Preprocessor::missingInclude (const std::string &filename, unsigned int linenr, unsigned int col, const std::string &header, HeaderTypes headerType)
914914{
915915 if (!mSettings .checks .isEnabled (Checks::missingInclude))
916916 return ;
917917
918918 std::list<ErrorMessage::FileLocation> locationList;
919919 if (!filename.empty ()) {
920- locationList.emplace_back (filename, linenr, 0 );
920+ locationList.emplace_back (filename, linenr, col );
921921 }
922922 ErrorMessage errmsg (std::move (locationList), mFile0 , Severity::information,
923923 (headerType==SystemHeader) ?
@@ -933,8 +933,8 @@ void Preprocessor::getErrorMessages(ErrorLogger &errorLogger, const Settings &se
933933 std::vector<std::string> files;
934934 simplecpp::TokenList tokens (files);
935935 Preprocessor preprocessor (tokens, settings, errorLogger, Standards::Language::CPP);
936- preprocessor.missingInclude (" " , 1 , " " , UserHeader);
937- preprocessor.missingInclude (" " , 1 , " " , SystemHeader);
936+ preprocessor.missingInclude (" " , 1 , 2 , " " , UserHeader);
937+ preprocessor.missingInclude (" " , 1 , 2 , " " , SystemHeader);
938938 preprocessor.error (" " , 1 , " #error message" ); // #error ..
939939}
940940
0 commit comments