From d7778df86336f3becb561463ae24243ccfe02164 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Fri, 6 Jan 2017 16:42:35 -0500 Subject: Renamed Slice/keyword test to clash, and added identifier-clash test --- cpp/src/slice2objc/Gen.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cpp/src/slice2objc/Gen.cpp') diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp index 4dcd484ba63..866f0e5d2db 100644 --- a/cpp/src/slice2objc/Gen.cpp +++ b/cpp/src/slice2objc/Gen.cpp @@ -759,8 +759,6 @@ Slice::Gen::generate(const UnitPtr& p) // Necessary for objc_getClass use when marshalling/unmarshalling proxies. _M << nl << "#import "; - _M << nl; - StringList includes = p->includeFiles(); for(StringList::const_iterator q = includes.begin(); q != includes.end(); ++q) { @@ -787,7 +785,6 @@ Slice::Gen::generate(const UnitPtr& p) _M << nl << "#ifndef " << _dllExport << "_EXPORTS"; _M << nl << "# define " << _dllExport << "_EXPORTS"; _M << nl << "#endif"; - _M << nl; _H << nl; _H << nl << "#ifndef " << _dllExport; @@ -806,6 +803,15 @@ Slice::Gen::generate(const UnitPtr& p) _dllExport += " "; } + // + // Disable shadow warnings in .cppm file + // + _M << sp; + _M.zeroIndent(); + _M << nl << "#ifdef __clang__"; + _M << nl << "# pragma clang diagnostic ignored \"-Wshadow-ivar\""; + _M << nl << "#endif"; + UnitVisitor unitVisitor(_H, _M, _dllExport); p->visit(&unitVisitor, false); -- cgit v1.2.3