summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Slice/Parser.h3
-rw-r--r--cpp/src/Slice/Parser.cpp12
2 files changed, 11 insertions, 4 deletions
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h
index 77de74b53e2..9d0d1f6d761 100644
--- a/cpp/include/Slice/Parser.h
+++ b/cpp/include/Slice/Parser.h
@@ -423,7 +423,8 @@ public:
bool checkIntroduced(const std::string&, ContainedPtr = 0);
// TODO: remove final (defaulted) bool parameter once deprecated features are outlawed.
bool nameIsLegal(const std::string&, const char *, bool = false);
- bool checkForGlobalDef(const std::string&, const char *);
+ // TODO: remove final (defaulted) bool parameter once deprecated features are outlawed.
+ bool checkForGlobalDef(const std::string&, const char *, bool = false);
protected:
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;
}