summaryrefslogtreecommitdiff
path: root/cpp/src/slice2objc/Gen.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-01-06 16:42:35 -0500
committerBernard Normier <bernard@zeroc.com>2017-01-06 16:42:35 -0500
commitd7778df86336f3becb561463ae24243ccfe02164 (patch)
tree4e437427a9d333b44665fbdecea239350c800522 /cpp/src/slice2objc/Gen.cpp
parentTest script fix, don't terminate the process twice (diff)
downloadice-d7778df86336f3becb561463ae24243ccfe02164.tar.bz2
ice-d7778df86336f3becb561463ae24243ccfe02164.tar.xz
ice-d7778df86336f3becb561463ae24243ccfe02164.zip
Renamed Slice/keyword test to clash, and added identifier-clash test
Diffstat (limited to 'cpp/src/slice2objc/Gen.cpp')
-rw-r--r--cpp/src/slice2objc/Gen.cpp12
1 files changed, 9 insertions, 3 deletions
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 <objc/runtime.h>";
- _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);