Browse Source

CppParser: fix warning about Parser

Fix the following warning by renaming ParserResult::Parser to
CodeParser.

In file included from ../../../src/CppParser/Parser.h:16:0,
                 from ../../../src/CppParser/Comments.cpp:8:
../../../src/CppParser/CppParser.h:86:13: warning: declaration of ‘CppSharp::CppParser::Parser* CppSharp::CppParser::ParserResult::Parser’ [-fpermissive]
     Parser* Parser;
             ^
../../../src/CppParser/CppParser.h:73:8: warning: changes meaning of ‘Parser’ from ‘struct CppSharp::CppParser::Parser’ [-fpermissive]
 struct Parser;
        ^

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
pull/262/head
Tomi Valkeinen 11 years ago
parent
commit
6536beb0ab
  1. 6
      src/CppParser/CppParser.cpp
  2. 2
      src/CppParser/CppParser.h
  3. 8
      src/CppParser/Parser.cpp

6
src/CppParser/CppParser.cpp

@ -33,7 +33,7 @@ DEF_STRING(ParserTargetInfo, ABI)
ParserResult::ParserResult() ParserResult::ParserResult()
: ASTContext(0) : ASTContext(0)
, Library(0) , Library(0)
, Parser(0) , CodeParser(0)
{ {
} }
@ -42,12 +42,12 @@ ParserResult::ParserResult(const ParserResult& rhs)
, Diagnostics(rhs.Diagnostics) , Diagnostics(rhs.Diagnostics)
, ASTContext(rhs.ASTContext) , ASTContext(rhs.ASTContext)
, Library(rhs.Library) , Library(rhs.Library)
, Parser(rhs.Parser) , CodeParser(rhs.CodeParser)
{} {}
ParserResult::~ParserResult() ParserResult::~ParserResult()
{ {
delete Parser; delete CodeParser;
} }
ParserDiagnostic::ParserDiagnostic() {} ParserDiagnostic::ParserDiagnostic() {}

2
src/CppParser/CppParser.h

@ -83,7 +83,7 @@ struct CS_API ParserResult
CppSharp::CppParser::AST::ASTContext* ASTContext; CppSharp::CppParser::AST::ASTContext* ASTContext;
CppSharp::CppParser::AST::NativeLibrary* Library; CppSharp::CppParser::AST::NativeLibrary* Library;
Parser* Parser; Parser* CodeParser;
}; };
enum class SourceLocationKind enum class SourceLocationKind

8
src/CppParser/Parser.cpp

@ -2940,8 +2940,8 @@ ParserResult* ClangParser::ParseHeader(ParserOptions* Opts)
return nullptr; return nullptr;
auto res = new ParserResult(); auto res = new ParserResult();
res->Parser = new Parser(Opts); res->CodeParser = new Parser(Opts);
return res->Parser->ParseHeader(Opts->FileName, res); return res->CodeParser->ParseHeader(Opts->FileName, res);
} }
ParserResult* ClangParser::ParseLibrary(ParserOptions* Opts) ParserResult* ClangParser::ParseLibrary(ParserOptions* Opts)
@ -2950,8 +2950,8 @@ ParserResult* ClangParser::ParseLibrary(ParserOptions* Opts)
return nullptr; return nullptr;
auto res = new ParserResult(); auto res = new ParserResult();
res->Parser = new Parser(Opts); res->CodeParser = new Parser(Opts);
return res->Parser->ParseLibrary(Opts->FileName, res); return res->CodeParser->ParseLibrary(Opts->FileName, res);
} }
ParserTargetInfo* ClangParser::GetTargetInfo(ParserOptions* Opts) ParserTargetInfo* ClangParser::GetTargetInfo(ParserOptions* Opts)

Loading…
Cancel
Save