summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Fix DocumentOutline for conceptsKadir Cetinkaya2020-06-232-2/+14
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/256 Reviewers: kbobyrev Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73056 (cherry picked from commit fb3d9153c01b9a560680465190d6ecd804e4c486)
* [clangd] Use printf instead of `echo -e` to be compliant with dashKadir Cetinkaya2020-06-161-2/+2
| | | | (cherry picked from commit ca1c21d4b659bfa5edb38c4a54b3050e43c4b51a)
* [clangd] Disable dependency-output lit test on windowsKadir Cetinkaya2020-06-161-0/+1
| | | | (cherry picked from commit a940a246f5e14a8fd44586f609b8a675eb949469)
* [clangd] Preserve -nostdinc and --sysroot when calling query driverKadir Cetinkaya2020-06-102-13/+47
| | | | | | | | | | | | | | Solves this issue: https://github.com/clangd/clangd/issues/157 This is my first contribution to an llvm project, so I hope I'm doing it right! Patch by @topisani (Tobias Pisani)! Reviewers: kadircet, klimek Differential Revision: https://reviews.llvm.org/D73811 (cherry picked from commit 6e8d6bc9ec8739ec22b73a23f740f171f452e234)
* [clangd] Fix a crash for accessing a null template decl returned by ↵Haojian Wu2020-06-102-9/+37
| | | | | | | | | | | | | | | | | | | findExplicitReferences. Summary: Fixes https://github.com/clangd/clangd/issues/347. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78626 (cherry picked from commit 7d1ee639cb9efea364bec90afe4d1161ec624a7f) Includes some test-only changes from f651c402a221a20f3bc6ea43f70b29326a357010 to support the cherry-picked tests. Test tweaked slightly as it exhibits a separate bug that was fixed on master.
* [clangd] Increase stack size of the new threads on macOSSam McCall2020-06-102-10/+32
| | | | | | | | | | | | | | | | | | | | Summary: By default it's 512K, which is way to small for clang parser to run on. There is no way to do it via platform-independent API, so it's implemented via pthreads directly in clangd/Threading.cpp. Fixes https://github.com/clangd/clangd/issues/273 Patch by Dmitry Kozhevnikov! Reviewers: ilya-biryukov, sammccall, arphaman Reviewed By: ilya-biryukov, sammccall, arphaman Subscribers: dexonsmith, umanwizard, jfb, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50993 (cherry picked from commit 69a39dc1f0d08ea43bac03a87bb8bff3937ce2e7)
* [clangd] Make use of SourceOrder to find first initializer in DefineOutlineKadir Cetinkaya2020-06-102-11/+45
| | | | | | | | | | | | | | | | | | | | | Summary: Constructors can have implicit initializers, this was crashing define outline. Make sure we find the first "written" ctor initializer to figure out `:` location. Fixes https://github.com/clangd/clangd/issues/400 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80521 (cherry picked from commit eeedbd033612e105755156023bdeec2fba4eca21) Fixes https://github.com/clangd/clangd/issues/418
* [clangd] Filter pch related flags coming from the userKadir Cetinkaya2020-06-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: PCH format is unstable, hence using a preamble built with a different version of clang (or even worse, a different compiler) might result in unexpected behaviour. PCH creation on the other hand is something clangd wouldn't want to perform, as it doesn't generate any output files. This patch makes sure clangd drops any PCH related compile commands after parsing the command line args. Fixes https://github.com/clangd/clangd/issues/248 Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D79669 (cherry picked from commit 35d867a790c2bcf2008b2ee1895ae8af2793b797) Dropped the test as it depends on nontrivial changes from master. The code is very simple and identical to that tested on master. Fixes https://github.com/clangd/clangd/issues/419
* [clangd] Fix early selection for non-vardecl declaratorsKadir Cetinkaya2020-06-103-6/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: Selection tree was performing an early claim only for VarDecls, but there are other cases where we can have declarators, e.g. FieldDecls. This patch extends the early claim logic to all types of declarators. Fixes https://github.com/clangd/clangd/issues/292 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75106 (cherry picked from commit e6b8181895b96740dbe54aca036aa237e0a8363d) Modified the cherry-picked test as diagnostics differ on the branch. Fixes https://github.com/clangd/clangd/issues/421
* [clangd] Disable all dependency outputsKadir Cetinkaya2020-06-102-0/+21
| | | | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/322 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78833 (cherry picked from commit 294b9d43cae77ea15453ec82203368903db4f538) Fixes https://github.com/clangd/clangd/issues/422
* [clangd][Hover] Handle uninstantiated default argsKadir Cetinkaya2020-06-102-2/+32
| | | | | | | | | | | | | | | | | | | Summary: Default args might exist but be unparsed or uninstantiated. getDefaultArg asserts on those. This patch makes sure we don't crash in such scenarios. Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73723 (cherry-picked from commit 9c903d0373ff940f9143efab8d948edf776de9f1) Fixes https://github.com/clangd/clangd/issues/424
* [clangd] Don't assert when completing a lambda variable inside the lambda.Sam McCall2020-06-105-6/+45
| | | | | | | | | | | | | | | | | | | Summary: This is a fairly ugly hack - we back off several features for any variable whose type isn't deduced, to avoid computing/caching linkage. Better suggestions welcome. Fixes https://github.com/clangd/clangd/issues/274 Reviewers: kadircet, kbobyrev Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73960 (cherry picked from commit 2629035a009095f62f48413e175437261165ecd7)
* [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.Haojian Wu2020-06-102-9/+35
| | | | | | | | | | | | | | | | | Summary: this maybe not ideal, but it is trivial and does fix the crash. Fixes https://github.com/clangd/clangd/issues/156. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78715 (cherry picked from commit a466e4be3831848d7ff6ffbe4f57d99de8fb66af)
* [clangd] Add the missing elaborated types in FindTarget.Haojian Wu2020-06-102-0/+11
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74025 (cherry picked from commit eaf0c89ec5f866b6cef296c542c030bb2cf8481d)
* [clangd] Handle the missing injectedClassNameType in targetDecl.Haojian Wu2020-06-102-0/+13
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73102 (cherry picked from commit 5d4e89975714875a86cb8e62b60d93eebefa4029)
* [clangd] Fix null check in FindTarget.Sam McCall2020-06-101-1/+1
| | | | | | | I've hit this stack trace a few times but don't have a good reproducer. The code is unsafe by inspection, though. (cherry picked from commit 9a5c448a31bacc08e73fcae4636094f9b6e2be6a)
* Add new website to release notes.Sam McCall2020-03-161-0/+2
|
* [clangd] DefineOutline won't copy virtual specifiers on methodsNathan James2020-03-042-4/+224
| | | | | | | | | | | | | | | | | | Summary: The define out of line refactor tool previously would copy the `virtual`, `override` and `final` specifier into the out of line method definition. This results in malformed code as those specifiers aren't allowed outside the class definition. Reviewers: hokein, kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D75429 (cherry picked from commit b2666ccca0277371a09e43a0a5a0f78029ba81e5)
* ReleaseNotes: remove in-progress warnings, tidy up a bitHans Wennborg2020-02-281-52/+8
|
* [docs] clangd release notesSam McCall2020-02-251-1/+44
|
* [clangd] Make output order of allTargetDecls deterministicKadir Cetinkaya2020-02-191-32/+49
| | | | | | | | | | | | | | | | | Summary: Makes use of insertion order to stabilize output for multiple decls. Fixes https://bugs.llvm.org/show_bug.cgi?id=44564 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits, aemerson Tags: #clang Differential Revision: https://reviews.llvm.org/D72826 (cherry picked from commit d54d71b67e602674a255e299a22fe31dee1f3619)
* Fix crash in InfinteLoopCheckNathan James2020-02-171-0/+2
| | | | (cherry picked from commit 8c4cf23dee1ac3f259c4795b275cc9bb1234aa29)
* [clangd] Expose Code Completion score to the clientKirill Bobyrev2020-02-138-0/+21
| | | | | | | | | | | | | | | | Summary: Make it possible for the client to adjust the ranking by using the score Clangd calculates for the completion items. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74547 (cherry picked from commit ff7b5bac04fa4946935ea45214e29f267d6c1d7b)
* [clang-tidy] Added check to disable bugprone-infinite-loop on known false ↵Nathan James2020-02-122-0/+19
| | | | | | | | | | | | | | | | | | condition Summary: Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=44816 | bugprone-infinite-loop false positive with CATCH2 ]] by disabling the check on loops where the condition is known to always eval as false, in other words not a loop. Reviewers: aaron.ballman, alexfh, hokein, gribozavr2, JonasToth Reviewed By: gribozavr2 Subscribers: xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D74374 (cherry picked from commit c69ec6476806147e46bf09b693acb24177982dc2)
* [clang-tidy] Fix false positive for cppcoreguidelines-init-variablesNathan James2020-02-102-5/+15
| | | | | | | | | | | | | | | | Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44746 | False positive for cppcoreguidelines-init-variables in range based for loop in template function ]] Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2 Reviewed By: aaron.ballman Subscribers: merge_guards_bot, xazax.hun, wuzish, nemanjai, kbarton, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D73843 (cherry picked from commit efcd09cea9a51c522954aa24e4b5513266daf6c3)
* [clangd] Add workaround for GCC5 host compilers. NFC.Michael Liao2020-02-061-1/+7
| | | | (cherry picked from commit 40514a7d7a3b745ba43c2d014e54a0d78d65d957)
* [clang-tidy] Fixed crash 44745 in readability-else-after-returnNathan James2020-02-032-0/+17
| | | | | | | | | | | | | | | | Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44745 | readability-else-after-return crashes ]] Reviewers: aaron.ballman, alexfh, hokein, JonasToth, gribozavr2 Reviewed By: alexfh Subscribers: merge_guards_bot, xazax.hun, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D73841 (cherry picked from commit d591bdce6d623208d4aeb335a762d839f0f8f0f7)
* [clangd] Don't mmap source files on all platforms --> don't crash on git ↵Sam McCall2020-01-292-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checkout Summary: Previously we mmapped on unix and not on windows: on windows mmap takes an exclusive lock on the file and prevents the user saving changes! The failure mode on linux is a bit more subtle: if the file is changed on disk but the SourceManager sticks around, then subsequent operations on the SourceManager will fail as invariants are violated (e.g. null-termination). This commonly manifests as crashes after switching git branches with many files open in clangd. Nominally mmap is for performance here, and we should be willing to give some up to stop crashing. Measurements on my system (linux+desktop+SSD) at least show no measurable regression on an a fairly IO-heavy workload: drop disk caches, open SemaOverload.cpp, wait for first diagnostics. for i in `seq 100`; do for variant in mmap volatile; do echo 3 | sudo tee /proc/sys/vm/drop_caches /usr/bin/time --append --quiet -o ~/timings -f "%C %E" \ bin/clangd.$variant -sync -background-index=0 < /tmp/mirror > /dev/null done done bin/clangd.mmap -sync -background-index=0 0:07.60 bin/clangd.volatile -sync -background-index=0 0:07.89 bin/clangd.mmap -sync -background-index=0 0:07.44 bin/clangd.volatile -sync -background-index=0 0:07.89 bin/clangd.mmap -sync -background-index=0 0:07.42 bin/clangd.volatile -sync -background-index=0 0:07.50 bin/clangd.mmap -sync -background-index=0 0:07.90 bin/clangd.volatile -sync -background-index=0 0:07.53 bin/clangd.mmap -sync -background-index=0 0:07.64 bin/clangd.volatile -sync -background-index=0 0:07.55 bin/clangd.mmap -sync -background-index=0 0:07.75 bin/clangd.volatile -sync -background-index=0 0:07.47 bin/clangd.mmap -sync -background-index=0 0:07.90 bin/clangd.volatile -sync -background-index=0 0:07.50 bin/clangd.mmap -sync -background-index=0 0:07.81 bin/clangd.volatile -sync -background-index=0 0:07.95 bin/clangd.mmap -sync -background-index=0 0:07.55 bin/clangd.volatile -sync -background-index=0 0:07.65 bin/clangd.mmap -sync -background-index=0 0:08.15 bin/clangd.volatile -sync -background-index=0 0:07.54 bin/clangd.mmap -sync -background-index=0 0:07.78 bin/clangd.volatile -sync -background-index=0 0:07.61 bin/clangd.mmap -sync -background-index=0 0:07.78 bin/clangd.volatile -sync -background-index=0 0:07.55 bin/clangd.mmap -sync -background-index=0 0:07.41 bin/clangd.volatile -sync -background-index=0 0:07.40 bin/clangd.mmap -sync -background-index=0 0:07.54 bin/clangd.volatile -sync -background-index=0 0:07.42 bin/clangd.mmap -sync -background-index=0 0:07.45 bin/clangd.volatile -sync -background-index=0 0:07.49 bin/clangd.mmap -sync -background-index=0 0:07.95 bin/clangd.volatile -sync -background-index=0 0:07.66 bin/clangd.mmap -sync -background-index=0 0:08.04 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73617 (cherry picked from commit b500c49cd4f81f067cda721049cb1fd72a5e7bf5)
* [clan-tidy] Fix false positive in bugprone-infinite-loopAdam Balogh2020-01-292-5/+57
| | | | | | | | | | | | | | The checker bugprone-infinite-loop does not track changes of variables in the initialization expression of a variable declared inside the condition of the while statement. This leads to false positives, similarly to the one in the bug report https://bugs.llvm.org/show_bug.cgi?id=44618. This patch fixes this issue by enabling tracking of the variables of this expression as well. Differential Revision: https://reviews.llvm.org/D73270 (cherry picked from commit 70f4c6e7b14f225f9628fbdab3620ce037613351)
* [clangd][Hover] Make tests hermetic by setting target tripletKadir Cetinkaya2020-01-291-43/+28
| | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=44696 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73613 (cherry picked from commit 55b0e9c9d5de7c5d70552ac9ca9ffc14097e983b)
* [clangd][Hover] Handle uninstantiated templatesKadir Cetinkaya2020-01-282-9/+37
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/263 Reviewers: hokein, sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73344 (cherry picked from commit a31a61dafeaa9110687110fc127ea6f7c91dd3e6)
* [clangd][Hover] Change arrow in return type back to →Kadir Cetinkaya2020-01-273-4/+4
| | | | | | | | | | | | | | | | Summary: Currently 🡺 is used in hover response to represent return types, but it is not widely available. Changing this back to original to support more clients. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73336 (cherry picked from commit 1b996faa1575bda6b99e778aaabe14834c10d3ff)
* [clangd] Drop returntype/type when hovering over type-ish namesKadir Cetinkaya2020-01-272-15/+21
| | | | | | | | | | | | | | | | | | Summary: Some names, e.g. constructor/destructor/conversions, already contain the type info, no need to duplicate them in the hoverinfo. Fixes https://github.com/clangd/clangd/issues/252 Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73110 (cherry picked from commit 1fbb1d6df0113ca341f6d257bc72e07343dd861a)
* [clangd] Print underlying type for decltypes in hoverKadir Cetinkaya2020-01-272-15/+74
| | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/249 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72498 (cherry picked from commit 0474fe465d8feebcfd54a16d93ad8518b5625972)
* [clangd] Dont display `<unknown>` kinds in hover boardKadir Cetinkaya2020-01-272-2/+3
| | | | | | | | | | | | | | | | | | Summary: Currently when hovering over an `auto` or `decltype` that resolve to a builtin-type, clangd would display `<unknown>` as the kind of the symbol. Drop that to make rendering nicer. Reviewers: usaxena95 Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72777 (cherry picked from commit b08e8353a89f682861ef947fdb6e229b3de2e37d)
* [clangd] Extract string literals in macro arguments to unbreak gcc buildbotsKadir Cetinkaya2020-01-271-4/+7
| | | | (cherry picked from commit 041650da67051266eb92b5bb07223394fe1bdab1)
* [clangd] Fix windows buildbotsKadir Cetinkaya2020-01-271-20/+43
| | | | (cherry picked from commit 60adfb83cda883d9fc1079c89d2feaa681a41b90)
* [clangd] Rearrange type, returntype and parameters in hover cardKadir Cetinkaya2020-01-273-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Moves type/returntype into its own line as it is more readable in cases where the type is long. Also gives parameter lists a heading, `Parameters:` to make them stand out. Leaves the `right arrow` instead of `Returns: ` before Return Type to make output more symmetric. ``` function foo Returns: ret_type Parameters: - int x ``` vs ``` function foo 🡺 ret_type Parameters: - int x ``` Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72623 (cherry picked from commit 44f9c7a820c1e5fb949f441214a46b13588ff51a)
* [clangd] Add a ruler after header in hoverKadir Cetinkaya2020-01-275-15/+103
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72622 (cherry picked from commit d74a3d470c316f8fade90fe231fc0a51361c01e6)
* [clangd] Show hower info for expressionsKadir Cetinkaya2020-01-272-2/+83
| | | | | | | | | | | | | | | | | | Summary: This currently populates only the Name with the expression's type and Value if expression is evaluatable. Fixes https://github.com/clangd/clangd/issues/56 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72500 (cherry picked from commit 4d14bfaa2cb1610104db6b0818fc7d74fad1bd8f)
* Include <cstdlib> for std::abort() in clangdDimitry Andric2020-01-271-0/+1
| | | | | | | This fixes a "not a member of 'std'" error with e.g. Fedora 32. Closes: #105 (cherry picked from commit 58592f6c49249293f79698cfcb31dba532e12603)
* [clang-tidy] Fix check for generic lambda invented template parametersSaar Raz2020-01-241-1/+1
| | | | | | | | | clang-tidy previously relied on there being no identifier for a TemplateTypeParmDecl for checking whether 'decltype(x)' should be inserted, instead of checking whether or not it is implicit. D65042 added new names for invented generic lambda template parameters, rendering that check incorrect. (cherry picked from commit 5fdad8e3f803adce501ca25118f325184e54018d)
* [clang-tidy] Disable Checks on If constexpr statements in template ↵Nathan2020-01-234-2/+112
| | | | | | | | | | | | | | | | | | Instantiations for BugproneBranchClone and ReadabilityBracesAroundStatements Summary: fixes [[ https://bugs.llvm.org/show_bug.cgi?id=32203 | readability-braces-around-statements broken for if constexpr]] and [[ https://bugs.llvm.org/show_bug.cgi?id=44229 | bugprone-branch-clone false positive with template functions and constexpr ]] by disabling the relevant checks on if constexpr statements while inside an instantiated template. This is due to how the else branch of an if constexpr statement is folded away to a null statement if the condition evaluates to false Reviewers: alexfh, hokein, aaron.ballman, xazax.hun Reviewed By: aaron.ballman, xazax.hun Subscribers: rnkovacs, JonasToth, Jim, lebedev.ri, xazax.hun, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D71980 (cherry picked from commit f9c46229e4ac29053747c96e08c574c6c48d544b)
* Added readability-qualified-auto checkNathan James2020-01-1411-0/+713
| | | | | | | | Adds a check that detects any auto variables that are deduced to a pointer or a const pointer then adds in the const and asterisk according. Will also check auto L value references that could be written as const. This relates to the coding standard https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto
* [clang-tidy] Match InitListExpr in modernize-use-default-member-initMalcolm Parsons2020-01-142-33/+33
| | | | | | | | | | | | | | | | | | Summary: modernize-use-default-member-init wasn't warning about redundant initialisers when the initialiser was an InitListExpr. Add initListExpr to the matcher. Fixes: PR44439 Reviewers: aaron.ballman, alexfh, JonasToth Reviewed By: aaron.ballman Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72691
* [clang-tidy] Ignore implicit casts in modernize-use-default-member-initMalcolm Parsons2020-01-142-5/+5
| | | | | | | | | | | | | | | | | | Summary: Initialising a pointer from nullptr involves an implicit cast. Ignore it after getting initialiser from InitListExpr. Fixes: PR44440 Reviewers: aaron.ballman, alexfh, JonasToth Reviewed By: JonasToth Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72630
* Fix a test case by adding -fno-delayed-template-parsing.Aaron Ballman2020-01-131-1/+1
|
* [clangd] Include expression in DecltypeTypeLoc sourcerange while building ↵Kadir Cetinkaya2020-01-132-0/+19
| | | | | | | | | | | | | | | | | | | | | | | SelectionTree Summary: Currently AST only contains the location for `decltype` keyword, therefore we were skipping expressions inside decltype while building selection tree. This patch extends source range in such cases to contain the expression as well. A proper fix would require changes to Sema and DecltypeTypeLoc to contain these location information. Fixes https://github.com/clangd/clangd/issues/250. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72594
* [clangd] Render header of hover card as a headingKadir Cetinkaya2020-01-135-1/+48
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D72625
* Fix readability-identifier-naming missing member variablesNathan James2020-01-132-6/+163
| | | | | Fixes PR41122 (missing fixes for member variables in a destructor) and PR29005 (does not rename class members in all locations).
OpenPOWER on IntegriCloud