Fix some -Wunused parameter issues (#8517)
diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.h b/src/google/protobuf/compiler/cpp/cpp_helpers.h
index 5fa019d..b53c46f 100644
--- a/src/google/protobuf/compiler/cpp/cpp_helpers.h
+++ b/src/google/protobuf/compiler/cpp/cpp_helpers.h
@@ -59,7 +59,7 @@
namespace compiler {
namespace cpp {
-inline std::string ProtobufNamespace(const Options& options) {
+inline std::string ProtobufNamespace(const Options& /* options */) {
return "PROTOBUF_NAMESPACE_ID";
}
@@ -67,12 +67,12 @@
return options.opensource_runtime ? "GOOGLE_PROTOBUF" : "GOOGLE_PROTOBUF";
}
-inline std::string DeprecatedAttribute(const Options& options,
+inline std::string DeprecatedAttribute(const Options& /* options */,
const FieldDescriptor* d) {
return d->options().deprecated() ? "PROTOBUF_DEPRECATED " : "";
}
-inline std::string DeprecatedAttribute(const Options& options,
+inline std::string DeprecatedAttribute(const Options& /* options */,
const EnumValueDescriptor* d) {
return d->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM " : "";
}
@@ -345,7 +345,7 @@
!options.opensource_runtime;
}
-inline bool IsFieldUsed(const FieldDescriptor* field, const Options& options) {
+inline bool IsFieldUsed(const FieldDescriptor* /* field */, const Options& /* options */) {
return true;
}
diff --git a/src/google/protobuf/compiler/importer.h b/src/google/protobuf/compiler/importer.h
index db4a876..6cdae8a 100644
--- a/src/google/protobuf/compiler/importer.h
+++ b/src/google/protobuf/compiler/importer.h
@@ -202,8 +202,8 @@
virtual void AddError(const std::string& filename, int line, int column,
const std::string& message) = 0;
- virtual void AddWarning(const std::string& filename, int line, int column,
- const std::string& message) {}
+ virtual void AddWarning(const std::string& /* filename */, int /* line */, int /* column */,
+ const std::string& /* message */) {}
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MultiFileErrorCollector);
diff --git a/src/google/protobuf/io/printer.h b/src/google/protobuf/io/printer.h
index 64336eb..904b818 100644
--- a/src/google/protobuf/io/printer.h
+++ b/src/google/protobuf/io/printer.h
@@ -65,7 +65,7 @@
// TODO(gerbens) I don't see why we need virtuals here. Just a vector of
// range, payload pairs stored in a context should suffice.
- virtual void AddAnnotationNew(Annotation& a) {}
+ virtual void AddAnnotationNew(Annotation& /* a */) {}
virtual ~AnnotationCollector() {}
};
diff --git a/src/google/protobuf/io/tokenizer.h b/src/google/protobuf/io/tokenizer.h
index 551516e..3be00f1 100644
--- a/src/google/protobuf/io/tokenizer.h
+++ b/src/google/protobuf/io/tokenizer.h
@@ -78,8 +78,8 @@
// Indicates that there was a warning in the input at the given line and
// column numbers. The numbers are zero-based, so you may want to add
// 1 to each before printing them.
- virtual void AddWarning(int line, ColumnNumber column,
- const std::string& message) {}
+ virtual void AddWarning(int /* line */, ColumnNumber /* column */,
+ const std::string& /* message */) {}
private:
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ErrorCollector);