summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.h
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-02-04 16:48:50 -0500
committerBernard Normier <bernard@zeroc.com>2017-02-04 16:48:50 -0500
commitabb5616afdbe48c59b0f09f4b11aaa6fc5bb13be (patch)
tree900cd08e75cd11aceee75c7ab93085cbea824e60 /cpp/src/Slice/Parser.h
parent Fixed (ICE-7556) - header-ext and makefile dependencies (diff)
downloadice-abb5616afdbe48c59b0f09f4b11aaa6fc5bb13be.tar.bz2
ice-abb5616afdbe48c59b0f09f4b11aaa6fc5bb13be.tar.xz
ice-abb5616afdbe48c59b0f09f4b11aaa6fc5bb13be.zip
Slice compilers now emit deprecated warning for classes with operations (ICE-7557)
Refactored suppress-warning implementation
Diffstat (limited to 'cpp/src/Slice/Parser.h')
-rw-r--r--cpp/src/Slice/Parser.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h
index 9363105a066..1c7fc8f2fea 100644
--- a/cpp/src/Slice/Parser.h
+++ b/cpp/src/Slice/Parser.h
@@ -66,6 +66,13 @@ enum FormatType
SlicedFormat // Full format.
};
+enum WarningCategory
+{
+ All,
+ Deprecated,
+ InvalidMetaData
+};
+
class GrammarBase;
class SyntaxTreeBase;
class Type;
@@ -235,17 +242,21 @@ public:
StringList getMetaData() const;
//
- // Check if we need to suppress the given warnings based
- // on the [["supress-warning"]] global meta-data
+ // Emit warning unless filtered out by [["suppress-warning"]]
//
- bool suppressWarning(const std::string& = "") const;
+ void warning(WarningCategory, const std::string&, int, const std::string&) const;
+ void warning(WarningCategory, const std::string&, const std::string&, const std::string&) const;
private:
+ bool suppressWarning(WarningCategory) const;
+ void initSuppressedWarnings();
+
int _includeLevel;
StringList _metaData;
std::string _filename;
bool _seenDefinition;
+ std::set<WarningCategory> _suppressedWarnings;
};
typedef ::IceUtil::Handle<DefinitionContext> DefinitionContextPtr;
@@ -1025,11 +1036,8 @@ public:
void setSeenDefinition();
- void error(const char*); // Not const, because error count is increased.
- void error(const std::string&); // Ditto.
-
- void warning(const char*) const;
- void warning(const std::string&) const;
+ void error(const std::string&); // Not const because error count is increased
+ void warning(WarningCategory, const std::string&) const;
ContainerPtr currentContainer() const;
void pushContainer(const ContainerPtr&);