Enable -Wunused-local-typedef
BUG=321833 TBR=brettw Review URL: https://codereview.chromium.org/722513003 Cr-Commit-Position: refs/heads/master@{#303892}
This commit is contained in:
base/memory
build
chrome/browser
components/pairing
sdch
third_party/libphonenumber
@ -669,7 +669,9 @@ TEST(ScopedPtrTest, SelfResetAbortsWithCustomDeleter) {
|
||||
TEST(ScopedPtrTest, SelfResetWithCustomDeleterOptOut) {
|
||||
// A custom deleter should be able to opt out of self-reset abort behavior.
|
||||
struct NoOpDeleter {
|
||||
#if !defined(NDEBUG)
|
||||
typedef void AllowSelfReset;
|
||||
#endif
|
||||
inline void operator()(int*) {}
|
||||
};
|
||||
scoped_ptr<int> owner(new int);
|
||||
|
@ -2516,9 +2516,6 @@
|
||||
# code generated by flex (used in angle) contains that keyword.
|
||||
# http://crbug.com/255186
|
||||
'-Wno-deprecated-register',
|
||||
|
||||
# TODO(hans): Clean this up. Or disable with finer granularity.
|
||||
'-Wno-unused-local-typedef',
|
||||
],
|
||||
},
|
||||
'includes': [ 'set_clang_warning_flags.gypi', ],
|
||||
|
@ -745,9 +745,6 @@ config("default_warnings") {
|
||||
|
||||
# TODO(thakis): Remove, http://crbug.com/263960
|
||||
"-Wno-reserved-user-defined-literal",
|
||||
|
||||
# TODO(hans): Clean this up. Or disable with finer granularity.
|
||||
"-Wno-unused-local-typedef",
|
||||
]
|
||||
}
|
||||
if (gcc_version >= 48) {
|
||||
|
@ -888,8 +888,6 @@ void EventRouter::DispatchDirectoryChangeEventWithEntryDefinition(
|
||||
const std::string* extension_id,
|
||||
bool watcher_error,
|
||||
const EntryDefinition& entry_definition) {
|
||||
typedef std::map<base::FilePath, drive::FileChange::ChangeList> ChangeListMap;
|
||||
|
||||
// TODO(mtomasz): Add support for watching files in File System Provider API.
|
||||
if (entry_definition.error != base::File::FILE_OK ||
|
||||
!entry_definition.is_directory) {
|
||||
|
@ -72,12 +72,6 @@ component("libgtk2ui") {
|
||||
"gconf_listener.h",
|
||||
]
|
||||
}
|
||||
if (is_clang) {
|
||||
# G_DEFINE_TYPE automatically generates a *get_instance_private inline
|
||||
# function after glib 2.37. That's unused. Prevent to complain about it.
|
||||
cflags = [ "-Wno-unused-function" ]
|
||||
}
|
||||
|
||||
defines = [ "LIBGTK2UI_IMPLEMENTATION" ]
|
||||
|
||||
configs += [
|
||||
@ -87,6 +81,23 @@ component("libgtk2ui") {
|
||||
"//printing:cups",
|
||||
]
|
||||
|
||||
# gn orders flags on a target before flags from configs. The default config
|
||||
# adds -Wall, and these flags have to be after -Wall -- so they need to come
|
||||
# from a config and can't be on the target directly.
|
||||
config("libgtk2ui_warnings") {
|
||||
if (is_clang) {
|
||||
cflags = [
|
||||
# G_DEFINE_TYPE automatically generates a *get_instance_private inline
|
||||
# function after glib 2.37. That's unused. Prevent to complain about it.
|
||||
"-Wno-unused-function",
|
||||
|
||||
# G_STATIC_ASSERT uses a typedef as a static_assert.
|
||||
"-Wno-unused-local-typedef",
|
||||
]
|
||||
}
|
||||
}
|
||||
configs += [ ":libgtk2ui_warnings", ]
|
||||
|
||||
deps = [
|
||||
"//base",
|
||||
"//base:i18n",
|
||||
|
@ -96,10 +96,13 @@
|
||||
],
|
||||
}],
|
||||
[ 'clang==1', {
|
||||
# G_DEFINE_TYPE automatically generates a *get_instance_private inline function after glib 2.37.
|
||||
# That's unused. Prevent to complain about it.
|
||||
'cflags': [
|
||||
# G_DEFINE_TYPE automatically generates a *get_instance_private inline function after glib 2.37.
|
||||
# That's unused. Prevent to complain about it.
|
||||
'-Wno-unused-function',
|
||||
|
||||
# G_STATIC_ASSERT uses a typedef as a static_assert.
|
||||
'-Wno-unused-local-typedef',
|
||||
],
|
||||
}],
|
||||
],
|
||||
|
@ -36,8 +36,6 @@ FakeHostPairingController::~FakeHostPairingController() {
|
||||
}
|
||||
|
||||
void FakeHostPairingController::ApplyConfig(const std::string& config) {
|
||||
typedef std::vector<std::string> Tokens;
|
||||
|
||||
base::StringPairs kv_pairs;
|
||||
CHECK(base::SplitStringIntoKeyValuePairs(config, ':', ',', &kv_pairs))
|
||||
<< "Wrong config format.";
|
||||
|
@ -45,6 +45,24 @@ static_library("sdch") {
|
||||
"//third_party/zlib",
|
||||
]
|
||||
|
||||
# gn orders flags on a target before flags from configs. The default config
|
||||
# adds -Wall, and these flags have to be after -Wall -- so they need to come
|
||||
# from a config and can't be on the target directly.
|
||||
config("sdch_warnings") {
|
||||
cflags = []
|
||||
if (is_linux) {
|
||||
# TODO(mostynb): remove this if open-vcdiff is ever updated for c++11:
|
||||
cflags += [ "-Wno-deprecated-declarations" ]
|
||||
}
|
||||
|
||||
if (is_clang) {
|
||||
# sdch uses the pre-c++11 typedef-as-static_assert hack.
|
||||
# https://code.google.com/p/open-vcdiff/issues/detail?id=44
|
||||
cflags += [ "-Wno-unused-local-typedef" ]
|
||||
}
|
||||
}
|
||||
configs += [ ":sdch_warnings" ]
|
||||
|
||||
if (is_linux || is_android) {
|
||||
include_dirs = [ "linux" ]
|
||||
} else if (is_ios) {
|
||||
@ -69,9 +87,5 @@ static_library("sdch") {
|
||||
} else {
|
||||
logging_file = rebase_path("logging_forward.h", root_build_dir)
|
||||
cflags = [ "-include", logging_file ]
|
||||
if (is_linux) {
|
||||
# TODO(mostynb): remove this if open-vcdiff is ever updated for c++11:
|
||||
cflags += [ "-Wno-deprecated-declarations" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,11 @@
|
||||
# introduce static initializers, and which prevents open-vcdiff's
|
||||
# logging.h from being used).
|
||||
'variables': {
|
||||
'clang_warning_flags': [
|
||||
# sdch uses the pre-c++11 typedef-as-static_assert hack.
|
||||
# https://code.google.com/p/open-vcdiff/issues/detail?id=44
|
||||
'-Wno-unused-local-typedef',
|
||||
],
|
||||
'logging_path': 'logging_forward.h',
|
||||
'conditions': [
|
||||
# gyp leaves unspecified what the cwd is when running the compiler,
|
||||
|
10
third_party/libphonenumber/BUILD.gn
vendored
10
third_party/libphonenumber/BUILD.gn
vendored
@ -92,6 +92,16 @@ test("libphonenumber_unittests") {
|
||||
|
||||
include_dirs = [ "src/test" ]
|
||||
|
||||
# gn orders flags on a target before flags from configs. The default config
|
||||
# adds -Wall, and these flags have to be after -Wall -- so they need to come
|
||||
# from a config and can't be on the target directly.
|
||||
config("libphonenumber_unittests_warnings") {
|
||||
if (is_clang) {
|
||||
cflags = [ "-Wno-unused-local-typedef" ]
|
||||
}
|
||||
}
|
||||
configs += [ ":libphonenumber_unittests_warnings" ]
|
||||
|
||||
deps = [
|
||||
":libphonenumber_without_metadata",
|
||||
"//base",
|
||||
|
@ -134,6 +134,8 @@
|
||||
'../../testing/gtest.gyp:gtest',
|
||||
'libphonenumber_without_metadata',
|
||||
],
|
||||
# TODO: https://code.google.com/p/libphonenumber/issues/detail?id=553
|
||||
'variables': { 'clang_warning_flags': [ '-Wno-unused-local-typedef' ] },
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'action': [
|
||||
|
Reference in New Issue
Block a user