Index: tools/clang/plugins/FindBadConstructsConsumer.cpp |
diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp |
index 4dc305e4a4e3d61bd751ce65f44812348e8335bc..ce44aeb595bf3890c54a0b8bc0460ff6ce37400d 100644 |
--- a/tools/clang/plugins/FindBadConstructsConsumer.cpp |
+++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp |
@@ -471,22 +471,30 @@ void FindBadConstructsConsumer::CheckVirtualSpecifiers( |
} |
} |
} |
+ // Again, only emit the warning if it doesn't originate from a macro in |
hans
2015/05/06 22:47:42
Silly question: what does "Again" refer to here?
|
+ // a system header. |
if (loc.isValid()) { |
- diagnostic().Report(loc, diag_method_requires_override_) |
- << FixItHint::CreateInsertion(loc, " override"); |
+ if (!InBannedDirectory(manager.getSpellingLoc(loc))) { |
dcheng
2015/05/06 22:44:26
It almost feels like this should be a helper.
rep
Nico
2015/05/06 22:49:24
I considered that, but it's really only this funct
|
+ diagnostic().Report(loc, diag_method_requires_override_) |
+ << FixItHint::CreateInsertion(loc, " override"); |
+ } |
} else { |
- diagnostic().Report(range.getBegin(), diag_method_requires_override_); |
+ if (!InBannedDirectory(manager.getSpellingLoc(range.getBegin()))) |
+ diagnostic().Report(range.getBegin(), diag_method_requires_override_); |
} |
} |
- if (final_attr && override_attr) { |
+ if (final_attr && override_attr && |
+ !InBannedDirectory( |
+ manager.getSpellingLoc(override_attr->getLocation()))) { |
diagnostic().Report(override_attr->getLocation(), |
diag_redundant_virtual_specifier_) |
<< override_attr << final_attr |
<< FixItHint::CreateRemoval(override_attr->getRange()); |
} |
- if (final_attr && !is_override) { |
+ if (final_attr && !is_override && |
+ !InBannedDirectory(manager.getSpellingLoc(method->getLocStart()))) { |
diagnostic().Report(method->getLocStart(), |
diag_base_method_virtual_and_final_) |
<< FixItRemovalForVirtual(manager, method) |