summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* Use std::unique_ptr in ClangTidyCheckFactoriesDmitri Gribenko2019-09-265-4/+11
| | | | | | | I had to explicitly define some destructors that could only be defined in the corresponding .cpp files. llvm-svn: 372978
* [clang-tidy] Make llvm-header-guard work on llvm git monorepoHaojian Wu2019-09-261-0/+7
| | | | | | | | | | | | | | Reviewers: gribozavr Reviewed By: gribozavr Subscribers: xazax.hun, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68026 llvm-svn: 372953
* [clang-tidy] Add missing InfiniteLoopCheck.h, InfiniteLoopCheck.cpp and test ↵Fangrui Song2019-09-244-0/+228
| | | | | | from D64736 llvm-svn: 372706
* Revert rL372693 : [clang-tidy] New bugprone-infinite-loop check for ↵Simon Pilgrim2019-09-242-4/+0
| | | | | | | | | | | | | | | | | | detecting obvious infinite loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 ------- Broke some buildbots "No SOURCES given to target: obj.clangTidyBugproneModule" llvm-svn: 372704
* [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite ↵Adam Balogh2019-09-242-0/+4
| | | | | | | | | | | | | | | | loops Finding infinite loops is well-known to be impossible (halting problem). However, it is possible to detect some obvious infinite loops, for example, if the loop condition is not changed. Detecting such loops is beneficial since the tests will hang on programs containing infinite loops so testing-time detection may be costly in large systems. Obvious cases are where the programmer forgets to increment/decrement the counter or increments/decrements the wrong variable. Differential Revision: https://reviews.llvm.org/D64736 llvm-svn: 372693
* Revert "[clang-tidy] Fix relative path in header-filter."Dmitri Gribenko2019-09-231-3/+1
| | | | | | | This reverts commit r372388. It made '-header-filter' inconsistent with paths printed in diagnostics. llvm-svn: 372601
* Removed an incorred namespace-end commentDmitri Gribenko2019-09-231-1/+1
| | | | llvm-svn: 372593
* [clang-tidy] Add check for classes missing -hash ⚠️Stephane Moore2019-09-214-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Apple documentation states that: "If two objects are equal, they must have the same hash value. This last point is particularly important if you define isEqual: in a subclass and intend to put instances of that subclass into a collection. Make sure you also define hash in your subclass." https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418795-isequal?language=objc In many or all versions of libobjc, -[NSObject isEqual:] is a pointer equality check and -[NSObject hash] returns the messaged object's pointer. A relatively common form of developer error is for a developer to override -isEqual: in a subclass without overriding -hash to ensure that hashes are equal for objects that are equal. It is assumed that an override of -isEqual: is a strong signal for changing the object's equality operator to something other than pointer equality which implies that a missing override of -hash could result in distinct objects being equal but having distinct hashes because they are independent instances. This added check flags classes that override -isEqual: but inherit NSObject's implementation of -hash to warn of the potential for unexpected behavior. The proper implementation of -hash is the responsibility of the developer and the check will only verify that the developer made an effort to properly implement -hash. Developers can set up unit tests to verify that their implementation of -hash is appropriate. Test Notes: Ran check-clang-tools. Reviewers: aaron.ballman, benhamilton Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67737 llvm-svn: 372445
* [clang-tidy] Fix relative path in header-filter.Dmitri Gribenko2019-09-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang-tidy supports output diagnostics from header files if user specifies --header-filter. But it can't handle relative path well. For example, the folder structure of a project is: ``` // a.h is in /src/a/a.h // b.h is in /src/b/b.h ... // c.cpp is in /src/c.cpp ``` Now, we set --header-filter as --header-filter=/a/. That means we only want to check header files under /src/a/ path, and ignore header files uder /src/b/ path, but in current implementation, clang-tidy will check /src/b/b.h also, because the name of b.h used in clang-tidy is /src/a/../b/b.h. This change tries to fix this issue. Reviewers: alexfh, hokein, aaron.ballman, gribozavr Reviewed By: gribozavr Subscribers: MyDeveloperDay, xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67501 Patch by Yubo Xie. llvm-svn: 372388
* [clang-tidy] Fix bugprone-argument-comment-check to correctly ignore ↵Yitzhak Mandelbaum2019-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit constructors. Summary: After revision 370919, this check incorrectly flags certain cases of implicit constructors. Specifically, if an argument is annotated with an argument-comment and the argument expression triggers an implicit constructor, then the argument comment is associated with argument of the implicit constructor. However, this only happens when the constructor has more than one argument. This revision fixes the check for implicit constructors and adds a regression test for this case. Note: r370919 didn't cause this bug, it simply uncovered it by fixing another bug that was masking the behavior. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67744 llvm-svn: 372317
* [clang-tidy] Fix a potential infinite loop in ↵Haojian Wu2019-09-181-0/+6
| | | | | | | | | | | | | | readability-isolate-declaration check. Reviewers: ilya-biryukov Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67654 llvm-svn: 372206
* [clang-tidy] add checks to bugprone-posix-returnJian Cai2019-09-162-16/+21
| | | | | | This check now also checks if any calls to pthread_* functions expect negative return values. These functions return either 0 on success or an errno on failure, which is positive only. llvm-svn: 372037
* [clang-tidy] performance-inefficient-vector-operation: Support proto ↵Haojian Wu2019-09-162-55/+124
| | | | | | | | | | | | | | | | | | | | | | | | | repeated field Summary: Finds calls that add element to protobuf repeated field in a loop without calling Reserve() before the loop. Calling Reserve() first can avoid unnecessary memory reallocations. A new option EnableProto is added to guard this feature. Patch by Cong Liu! Reviewers: gribozavr, alexfh, hokein, aaron.ballman Reviewed By: hokein Subscribers: lebedev.ri, xazax.hun, Eugene.Zelenko, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D67135 llvm-svn: 371963
* [ClangTidy] Adjust the name getCheckName to getCheckerName due to API change.Tim Shen2019-09-121-1/+1
| | | | llvm-svn: 371773
* [clang-tidy] Fix build with -DBUILD_SHARED_LIB=ONHeejin Ahn2019-09-121-0/+1
| | | | | | | | | | | | | | Summary: This fixes build failures with `-DBUILD_SHARED_LIB=ON` after D67419. Reviewers: NoQ Subscribers: mgorny, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67473 llvm-svn: 371706
* [analyzer] NFC: Move PathDiagnostic classes to libAnalysis.Artem Dergachev2019-09-111-4/+5
| | | | | | | | | | | | At this point the PathDiagnostic, PathDiagnosticLocation, PathDiagnosticPiece structures no longer rely on anything specific to Static Analyzer, so we can move them out of it for everybody to use. PathDiagnosticConsumers are still to be handed off. Differential Revision: https://reviews.llvm.org/D67419 llvm-svn: 371661
* [clang-tidy] Fix bug in bugprone-use-after-move checkYitzhak Mandelbaum2019-09-091-5/+12
| | | | | | | | | | | | | | | | | | | | Summary: The bugprone-use-after-move check exhibits false positives for certain uses of the C++17 if/switch init statements. These false positives are caused by a bug in the ExprSequence calculations. This revision adds tests for the false positives and fixes the corresponding sequence calculation. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67292 llvm-svn: 371396
* [clang-tidy] Make most ArgumentCommentCheck options local, as they should beAlexander Kornienko2019-09-051-13/+8
| | | | llvm-svn: 371076
* Add a bugprone-argument-comment option: IgnoreSingleArgument.Alexander Kornienko2019-09-052-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add bugprone-argument-comment option: IgnoreSingleArgument. When true, the check will ignore the single argument. Sometimes, it's not necessary to add comment to single argument. For example: > std::string name("Yubo Xie"); > pScreen->SetWidth(1920); > pScreen->SetHeight(1080); This option can ignore such single argument in bugprone-argument-comment check. Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits Tags: #clang Patch by Yubo Xie. Differential Revision: https://reviews.llvm.org/D67056 llvm-svn: 371075
* [clang-tidy] Fix bugprone-argument-comment bug: negative literal number is ↵Alexander Kornienko2019-09-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | not checked. Summary: For example: ``` void foo(int a); foo(-2); ``` should be fixed as: ``` foo(/*a=*/-2); ``` This change tries to fix this issue. Reviewers: alexfh, hokein, aaron.ballman Reviewed By: alexfh, aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Patch by Yubo Xie. Differential Revision: https://reviews.llvm.org/D67084 llvm-svn: 371072
* [clang-tidy] Fix definitions in headers check to respect qualifiersKadir Cetinkaya2019-09-051-2/+1
| | | | | | | | | | | | | | | | Summary: The check was generating a fix without taking qualifiers in return type into account. This patch changes the insertion location to be before qualifers. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67213 llvm-svn: 371022
* [clang-tidy] Fix bugprone-argument-comment bug if there are marcos.Alexander Kornienko2019-09-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fix bugprone-argument-comment bug if there are marcos. For example: ``` void j(int a, int b, int c); j(X(1), /*b=*/1, X(1)); ``` clang-tidy can't recognize comment "/*b=*/". It suggests fix like this: ``` j(X(1), /*b=*//*b=*/1, X(1)); ``` This change tries to fix this issue. Reviewers: alexfh, hokein, aaron.ballman Reviewed By: alexfh Subscribers: xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Patch by Yubo Xie. Differential Revision: https://reviews.llvm.org/D67080 llvm-svn: 370919
* [clang-tidy] Fix a false positive in unused-using-decl checkHaojian Wu2019-09-031-30/+47
| | | | | | | | | | The previous matcher "hasAnyTemplateArgument(templateArgument())" only matches the first template argument, but the check wants to iterate all template arguments. This patch fixes this. Also some refactorings in this patch (to make the code reusable). llvm-svn: 370760
* Make add_new_check.py's insertion of registerCheck<> match the sort orderDaniel Sanders2019-08-301-20/+39
| | | | | | | | | | | | | | | | | Summary: Following on from review comments in D65919 about the ordering of the registerCheck<> calls. Sort based on the check name which might be on the line after the registerCheck<> Reviewers: aaron.ballman Subscribers: cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66505 llvm-svn: 370527
* [clang-tidy] Add llvm-prefer-register-over-unsigned to clang-tidyDaniel Sanders2019-08-304-0/+104
| | | | | | | | | | | | | | | | | Summary: This clang-tidy check is looking for unsigned integer variables whose initializer starts with an implicit cast from llvm::Register and changes the type of the variable to llvm::Register (dropping the llvm:: where possible). Reviewers: arsenm, bogner Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, mgorny, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65919 llvm-svn: 370512
* Changed FrontendActionFactory::create to return a std::unique_ptrDmitri Gribenko2019-08-291-1/+3
| | | | | | | | | | Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66947 llvm-svn: 370379
* [clang-tidy] Fix the potential infinite loop in ↵Haojian Wu2019-08-281-0/+4
| | | | | | | | | | | | | | | | | | recordIsTriviallyDefaultConstructible. Summary: The recordIsTriviallyDefaultConstructible may cause an infinite loop when running on an ill-formed decl. Reviewers: gribozavr Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66874 llvm-svn: 370200
* [clang-tidy] readability-identifier-naming shouldn't complain about CRTP ↵Sam McCall2019-08-281-0/+10
| | | | | | | | | | | | | | pseudo-overrides Reviewers: ilya-biryukov Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66864 llvm-svn: 370193
* Use FileEntryRef for PPCallbacks::HasIncludeAlex Lorenz2019-08-272-2/+2
| | | | | | | | This fixes the issue where a filename dependendency was missing if the file that was referenced with __has_include() was accessed through a symlink in an earlier run, if the file manager was reused between runs. llvm-svn: 370081
* Refactor GlobList from an ad-hoc linked list to a vectorDmitri Gribenko2019-08-272-20/+31
| | | | | | | | | | | | Summary: I think it makes method implementations more obvious. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66788 llvm-svn: 370039
* Moved GlobList into a separate header fileDmitri Gribenko2019-08-267-65/+104
| | | | | | | | | | | | | | Summary: It is a separate abstraction that is used in more contexts than just a helper for ClangTidyDiagnosticConsumer. Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66747 llvm-svn: 369918
* [clang-tidy] TransformerClangTidyCheck: change choice of location for ↵Yitzhak Mandelbaum2019-08-261-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message. Summary: This patch changes the location specified to the `ClangTidyCheck::diag()`. Currently, the beginning of the matched range is used. This patch uses the beginning of the first fix's range. This change both simplifies the code and (hopefully) gives a more intuitive result: the reported location aligns with the fix(es) provided, rather than the (arbitrary) range of the rule's match. N.B. this patch will break the line offset numbers in lit tests if the first fix is not at the beginning of the match. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66676 llvm-svn: 369914
* Fix clang-tidy warning in clang-tidyBenjamin Kramer2019-08-231-1/+1
| | | | | | | | argument name 'FixDescription' in comment does not match parameter name 'Description' Patch by Nils Barth! llvm-svn: 369783
* [clang-tidy] Possibility of displaying duplicate warningsKristof Umann2019-08-231-2/+3
| | | | | | | | | | | | | | | | | | Summary: In case a checker is registered multiple times as an alias, the emitted warnings are uniqued by the report message. However, it is random which checker name is included in the warning. When processing the output of clang-tidy this behavior caused some problems. In this commit the uniquing key contains the checker name too. Reviewers: alexfh, xazax.hun, Szelethus, aaron.ballman, lebedev.ri, JonasToth, gribozavr Reviewed By: alexfh Subscribers: dkrupp, whisperity, rnkovacs, mgrang, cfe-commits Patch by Tibor Brunner! Tags: #clang Differential Revision: https://reviews.llvm.org/D65065 llvm-svn: 369763
* [clang-tidy] Don't emit google-runtime-references warning for functions ↵Haojian Wu2019-08-231-0/+3
| | | | | | | | | | | | | | | | | | defined in macros. Summary: The macro are usually defined in the common/base headers which are hard for normal users to modify it. Reviewers: gribozavr, alexfh Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66631 llvm-svn: 369739
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-2243-246/+246
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* [clang-tidy] Check for dynamically initialized statics in headers.Yuanfang Chen2019-08-214-0/+115
| | | | | | | | | | | | Finds instances where variables with static storage are initialized dynamically in header files. Reviewed By: aaron.ballman, alexfh Patch by Charles Zhang! Differential Revision: https://reviews.llvm.org/D62829 llvm-svn: 369568
* Fix typo. "piont" => "point"Richard Trieu2019-08-201-1/+1
| | | | | | Found by Chris Morris (cwmorris). llvm-svn: 369316
* [clang-tidy] Migrate objc-super-self to use isDerivedFrom 🚛Stephane Moore2019-08-161-30/+17
| | | | | | | | | | | | | | | | | | | | | Summary: This migrates objc-super-self to `isDerivedFrom` as it now supports matching Objective-C interface declarations. Test Notes: Ran clang tools tests. Reviewers: aaron.ballman, gribozavr Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66270 llvm-svn: 369081
* [analyzer] Analysis: Silence checkersCsaba Dabis2019-08-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces a new `analyzer-config` configuration: `-analyzer-config silence-checkers` which could be used to silence the given checkers. It accepts a semicolon separated list, packed into quotation marks, e.g: `-analyzer-config silence-checkers="core.DivideZero;core.NullDereference"` It could be used to "disable" core checkers, so they model the analysis as before, just if some of them are too noisy it prevents to emit reports. This patch also adds support for that new option to the scan-build. Passing the option `-disable-checker core.DivideZero` to the scan-build will be transferred to `-analyzer-config silence-checkers=core.DivideZero`. Reviewed By: NoQ, Szelethus Differential Revision: https://reviews.llvm.org/D66042 llvm-svn: 369078
* [clang-tidy] Migrate objc-forbidden-subclassing to use isDerivedFrom 🚛Stephane Moore2019-08-161-28/+1
| | | | | | | | | | | | | | | | | | | | | Summary: This migrates objc-forbidden-subclassing to `isDerivedFrom` as it now supports matching Objective-C interface declarations. Test Notes: Ran clang tools tests. Reviewers: aaron.ballman, gribozavr Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66269 llvm-svn: 369076
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-1435-51/+51
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` ↵Yitzhak Mandelbaum2019-08-131-1/+2
| | | | | | | | | | | | | | | | | | functionality. Summary: `buildMatchers` is the new, more general way to extract the matcher from a rule. This change migrates the code to use it instead of `buildMatcher`. Reviewers: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65879 llvm-svn: 368700
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-052-2/+2
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [clang-tidy] Add FixItHint for performance-noexcept-move-constructorZinovy Nis2019-08-041-2/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D65104 llvm-svn: 367785
* [clang-tools-extra] Adopt FileManager's error-returning APIsHarlan Haskins2019-08-011-2/+5
| | | | | | | | The FileManager has been updated to return llvm::ErrorOr from getFile and getDirectory, this commit updates all the callers of those APIs from clang. llvm-svn: 367617
* [clang-tidy]: Google: new check 'google-upgrade-googletest-case'Eric Fiselier2019-07-294-0/+398
| | | | | | | | | | | Introduce a new check to upgrade user code based on API changes in Googletest. The check finds uses of old Googletest APIs with "case" in their name and replaces them with the new APIs named with "suite". Patch by Alex Strelnikov (strel@google.com) Reviewed as D62977. llvm-svn: 367263
* [clang-tidy] Add a module for the Linux kernel.Tom Roeder2019-07-258-0/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Now that clang is going to be able to build the Linux kernel again on x86, and we have gen_compile_commands.py upstream for generating compile_commands.json, clang-tidy can be used on the Linux kernel source. To that end, this commit adds a new clang-tidy module to be used for checks specific to Linux kernel source. The Linux kernel follows its own style of C, and it will be useful to separate those checks into their own module. This also adds an initial check that makes sure that return values from the kernel error functions like PTR_ERR and ERR_PTR are checked. It also makes sure that any functions that directly return values from these functions are checked. Subscribers: xazax.hun, gribozavr, Eugene.Zelenko, lebedev.ri, mgorny, jdoerfert, cfe-commits Tags: #clang, #clang-tools-extra Reviewers: aaron.ballman, alexfh, hokein, JonasToth Differential Revision: https://reviews.llvm.org/D59963 llvm-svn: 367071
* [clang-tidy] Exclude forward decls from fuchsia-multiple-inheritanceJulie Hockett2019-07-171-1/+2
| | | | | | | | Addresses b39770. Differential Revision: https://reviews.llvm.org/D64813 llvm-svn: 366354
* [clang-tidy] Fix crash on end location inside macroNathan Huckleberry2019-07-171-6/+11
| | | | | | | | | | | | | | | | | | | | Summary: Lexer::getLocForEndOfToken is defined to return an invalid location if the given location is inside a macro. Other checks conditionally warn based off location validity. Updating this check to do the same. Reviewers: JonasToth, aaron.ballman, nickdesaulniers Reviewed By: nickdesaulniers Subscribers: lebedev.ri, nickdesaulniers, xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64607 llvm-svn: 366353
OpenPOWER on IntegriCloud