summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 53f1a7e32f2..1239077681b 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -619,7 +619,7 @@ Slice::Container::createClassDecl(const string& name, bool intf, bool local, boo
return 0;
}
- if(!checkForGlobalDef(name, intf ? "interface" : "class"))
+ if(!checkForGlobalDef(name, intf ? "interface" : "class", implicit))
{
return 0;
}
@@ -1956,8 +1956,11 @@ Slice::Container::nameIsLegal(const string& newName, const char* newConstruct, b
return true;
}
+//
+// TODO: remove the suppressWarnings parameter once deprecrecated features are outlawed.
+//
bool
-Slice::Container::checkForGlobalDef(const string& name, const char* newConstruct)
+Slice::Container::checkForGlobalDef(const string& name, const char* newConstruct, bool suppressWarnings)
{
if(dynamic_cast<Unit*>(this) && strcmp(newConstruct, "module"))
{
@@ -1975,7 +1978,10 @@ Slice::Container::checkForGlobalDef(const string& name, const char* newConstruct
}
else
{
- _unit->warning("`" + name + "': " + newConstruct + " definitions at global scope are deprecated");
+ if(!suppressWarnings)
+ {
+ _unit->warning("`" + name + "': " + newConstruct + " definitions at global scope are deprecated");
+ }
}
return true;
}