Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1490)

Side by Side Diff: tools/clang/plugins/FindBadConstructsConsumer.cpp

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "FindBadConstructsConsumer.h" 5 #include "FindBadConstructsConsumer.h"
6 6
7 #include "clang/Frontend/CompilerInstance.h" 7 #include "clang/Frontend/CompilerInstance.h"
8 #include "clang/AST/Attr.h" 8 #include "clang/AST/Attr.h"
9 #include "clang/Lex/Lexer.h" 9 #include "clang/Lex/Lexer.h"
10 #include "llvm/Support/raw_ostream.h" 10 #include "llvm/Support/raw_ostream.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // virtual method overrides a method from a base class, only the override 357 // virtual method overrides a method from a base class, only the override
358 // specifier should be used. If the method should not be overridden by derived 358 // specifier should be used. If the method should not be overridden by derived
359 // classes, only the final specifier should be used. 359 // classes, only the final specifier should be used.
360 void FindBadConstructsConsumer::CheckVirtualSpecifiers( 360 void FindBadConstructsConsumer::CheckVirtualSpecifiers(
361 const CXXMethodDecl* method) { 361 const CXXMethodDecl* method) {
362 bool is_override = method->size_overridden_methods() > 0; 362 bool is_override = method->size_overridden_methods() > 0;
363 bool has_virtual = method->isVirtualAsWritten(); 363 bool has_virtual = method->isVirtualAsWritten();
364 OverrideAttr* override_attr = method->getAttr<OverrideAttr>(); 364 OverrideAttr* override_attr = method->getAttr<OverrideAttr>();
365 FinalAttr* final_attr = method->getAttr<FinalAttr>(); 365 FinalAttr* final_attr = method->getAttr<FinalAttr>();
366 366
367 if (method->isPure()) 367 if (method->isPure() && !options_.strict_virtual_specifiers)
368 return; 368 return;
369 369
370 if (IsMethodInBannedOrTestingNamespace(method)) 370 if (IsMethodInBannedOrTestingNamespace(method))
371 return; 371 return;
372 372
373 if (isa<CXXDestructorDecl>(method) && !options_.strict_virtual_specifiers) 373 if (isa<CXXDestructorDecl>(method) && !options_.strict_virtual_specifiers)
374 return; 374 return;
375 375
376 SourceManager& manager = instance().getSourceManager(); 376 SourceManager& manager = instance().getSourceManager();
377 377
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 record->getTypeForDecl()->getAsCXXRecordDecl()) { 743 record->getTypeForDecl()->getAsCXXRecordDecl()) {
744 weak_ptr_factory_location = iter->getLocation(); 744 weak_ptr_factory_location = iter->getLocation();
745 } 745 }
746 } 746 }
747 } 747 }
748 } 748 }
749 } 749 }
750 } 750 }
751 751
752 } // namespace chrome_checker 752 } // namespace chrome_checker
OLDNEW
« no previous file with comments | « third_party/tcmalloc/vendor/vsprojects/tmu-static/tmu-static.vcproj ('k') | tools/clang/plugins/tests/virtual_specifiers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698