summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.Felix Berger2016-05-031-2/+3
| | | | | | | | | | Reviewers: alexfh Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D19849 llvm-svn: 268461
* [clang-tidy] Speedup misc-static-assert.Samuel Benzaquen2016-05-031-3/+7
| | | | | | | | | | | | | | | | | | | Summary: Speedup the misc-static-assert check by not use `stmt()` as the toplevel matcher. The framework runs a filter on the matchers before trying them on each node and uses the toplevel type for this. Using `stmt()` as the toplevel causes the matcher to be run on every `Stmt` node, even if the node doesn't match the desired types. This change speeds up clang-tidy by ~5% in a benchmark. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19877 llvm-svn: 268430
* Fix a crash in cppcoreguidelines-pro-type-member-init when checking a class ↵Haojian Wu2016-05-031-2/+2
| | | | | | | | | | | | | | | | that initializes itself as a base Summary: Fix a crash when a record type initializes itself in its own base class initializer list. Patch by Michael Miller! Reviewers: alexfh, aaron.ballman, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19802 llvm-svn: 268369
* [clang-tidy] Cleanup namespace in utils folder.Etienne Bergeron2016-05-0329-59/+88
| | | | | | | | | | | | | | Summary: This is a step forward cleaning up the namespaces in clang-tidy/utils. There is no behavior change. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19819 llvm-svn: 268356
* [clang-tidy] ProTypeMemberInitCheck - check that field decls do not have ↵Felix Berger2016-05-031-0/+2
| | | | | | | | | | | | in-class initializer. Reviewers: alexfh, JVApen, aaron.ballman Subscribers: flx, aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D18300 llvm-svn: 268352
* [Clang-tidy] Fix Clang-tidy modernize-use-override and some Include What You ↵Eugene Zelenko2016-05-031-3/+5
| | | | | | Use warnings in modernize/MakeSmartPtrCheck.h. llvm-svn: 268349
* [clang-tidy] Cleaning namespaces to be more consistant across checkers.Etienne Bergeron2016-05-0257-52/+137
| | | | | | | | | | | | | | Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264
* [clang-tidy] Add modernize-make-shared checkPiotr Padlewski2016-05-028-139/+302
| | | | | | | | | Because modernize-make-shared do almost the same job as modernize-make-unique, I refactored common code to MakeSmartPtrCheck. http://reviews.llvm.org/D19183 llvm-svn: 268253
* Add a clang-tidy check that flags string-to-number conversion functions that ↵Aaron Ballman2016-04-294-0/+277
| | | | | | | | have insufficient error checking, suggesting a better alternative. This check corresponds to: https://www.securecoding.cert.org/confluence/display/c/ERR34-C.+Detect+errors+when+converting+a+string+to+a+number llvm-svn: 268100
* Add boost-use-to-stringPiotr Padlewski2016-04-298-0/+170
| | | | | | http://reviews.llvm.org/D18136 llvm-svn: 268079
* small reformat to test accessPiotr Padlewski2016-04-291-27/+27
| | | | llvm-svn: 268076
* [clang-tidy] cppcoreguidelines-pro-type-member-init should not complain ↵Alexander Kornienko2016-04-281-0/+1
| | | | | | | | | | | | | | | | about static variables Summary: Variables with static storage duration are zero-initialized per [stmt.dcl]p4 and [basic.start.init]p2. Reviewers: sbenza, aaron.ballman Subscribers: michael_miller, flx, cfe-commits Differential Revision: http://reviews.llvm.org/D19672 llvm-svn: 267933
* Fix include path in ClangTidy.cpp.Stephen Hines2016-04-281-1/+1
| | | | | | | | | | | | | | Summary: https://llvm.org/bugs/show_bug.cgi?id=27355 To compile with other binary output directory structures in build systems like Android. Reviewers: srhines, alexfh Subscribers: tberghammer, danalbert, cfe-commits Differential Revision: http://reviews.llvm.org/D19249 llvm-svn: 267835
* Fix a crash in cppcoreguidelines-pro-type-member-init when checking a type ↵Haojian Wu2016-04-271-2/+6
| | | | | | | | | | | | | | | | with a template parameter as a base class. Summary: Fixed a crash in cppcoreguidelines-pro-type-member-init when encountering a type that uses one of its template parameters as a base when compiling for C++98. Patch by Michael Miller! Reviewers: aaron.ballman, alexfh, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19539 llvm-svn: 267700
* clang-tidy -list-checks should exit with non-zero code when no checks are ↵Alexander Kornienko2016-04-271-0/+4
| | | | | | enabled. llvm-svn: 267697
* [ClangTidy] Add an 'explain-checks' option to diagnose where each checks ↵Haojian Wu2016-04-273-25/+126
| | | | | | | | | | | | comes from. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18694 llvm-svn: 267683
* [clang-tidy] Now adding correct misc-move-const-arg documentation ;]Alexander Kornienko2016-04-261-10/+9
| | | | | | + brushed the code a bit and renamed the test file to match the check name llvm-svn: 267592
* [clang-tidy] New checker for redundant expressions.Etienne Bergeron2016-04-264-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker finds redundant expression on both side of a binary operator. The current implementation provide a function to check whether expressions are equivalent. This implementation is able to recognize the common subset encounter in C++ program. Side-effects like "x++" are not considered to be equivalent. There are many False Positives related to macros and to floating point computations (detecting NaN). The checker is ignoring these cases. Example: ``` if( !dst || dst->depth != desired_depth || dst->nChannels != desired_num_channels || dst_size.width != src_size.width || dst_size.height != dst_size.height ) <<--- bug { ``` Reviewers: alexfh Subscribers: danielmarjamaki, fahlgren, jordan_rose, zaks.anna, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19451 llvm-svn: 267574
* [clang-tidy] Enhance misc-suspicious-string-compare to move down ↵Etienne Bergeron2016-04-261-36/+42
| | | | | | | | | | | | | | | | | | | | | | false-positives. Summary: The checker was noisy when running over llvm code base. This patch is impriving the way string-compare functions are matched. 1) By default, do not report !strcmp(...) unless it's activate by the user, 2) Only match suspicious expression over a subset of expression (binary operator), 3) Added matching of macro wrapper used with clang on linux. See bug: 27465. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19497 llvm-svn: 267570
* A clang-tidy check for std:accumulate.Alexander Kornienko2016-04-264-0/+188
| | | | | | | | | | | | | | | | | Summary: For folds (e.g. std::accumulate), check matches between the provided init value and the range's value_type. A typical error is "std::accumulate(begin, end, 0);", where begin and end have float value_type. See the documentation for more examples. For now we check std::accumulate, std::reduce and std::inner_product. Reviewers: hokein, alexfh Subscribers: Prazek, aaron.ballman, cfe-commits, courbet Patch by Clément Courbet! Differential Revision: http://reviews.llvm.org/D18442 llvm-svn: 267542
* clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp: Use ↵NAKAMURA Takumi2016-04-231-1/+1
| | | | | | raw_string_ostream::str() to flush the buffer explicitly. llvm-svn: 267290
* [clang-tidy] Fix misc-macro-repeated-side-effects false positive with ↵Alexander Kornienko2016-04-231-0/+11
| | | | | | stringified arguments llvm-svn: 267254
* [Clang-tidy] Fix Clang warning in misc/StringConstructorCheck.h.Eugene Zelenko2016-04-221-1/+1
| | | | | | Using LLVM_ENABLE_WARNINGS=ON is good idea. llvm-svn: 267228
* clangTidyReadabilityModule: Add clangTidyUtils in libdeps, corresponding to ↵NAKAMURA Takumi2016-04-221-0/+1
| | | | | | r267003. llvm-svn: 267087
* [clang-tidy] Fix broken build bot.Etienne Bergeron2016-04-211-44/+44
| | | | | | | | | | | | | | | | | | | | | Summary: There is a build bot that doesn't support 'constexpr'. ``` FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Itools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\include -Itools\clang\include -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include -UNDEBUG /EHs-c- /GR- /showIncludes -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fotools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\SuspiciousStringCompareCheck.cpp.obj /Fdtools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C2144: syntax error : 'char' should be preceded by ';' D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ninja: build stopped: subcommand failed. program finished with exit code 1 ``` Reviewers: alexfh, sbenza Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19379 llvm-svn: 267027
* [clang-tidy] New checker to detect suspicious string constructor.Etienne Bergeron2016-04-214-0/+169
| | | | | | | | | | | | | | | | | | | Summary: Checker to validate string constructor parameters. A common mistake is to swap parameter for the fill-constructor. ``` std::string str('x', 4); std::string str('4', x); ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19146 llvm-svn: 267011
* [clang-tidy] Add new checker for comparison with runtime string functions.Etienne Bergeron2016-04-214-0/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This checker is validating suspicious usage of string compare functions. Example: ``` if (strcmp(...)) // Implicitly compare to zero if (!strcmp(...)) // Won't warn if (strcmp(...) != 0) // Won't warn ``` This patch was checked over large amount of code. There is three checks: [*] Implicit comparator to zero (coding-style, many warnings found), [*] Suspicious implicit cast to non-integral (bugs!?, almost none found), [*] Comparison to suspicious constant (bugs!?, found two cases), Example: [[https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c | https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c]] ``` else if(strcmp(id, "select") == 0) { array->array[i].key1 = 25; } else if(strcmp(id, "sk") == 28) // BUG!? { array->array[i].key1 = 20; } ``` Reviewers: alexfh Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D18703 llvm-svn: 267009
* [clang-tidy] Cleanup some ast-matchers and lift some to utils.Etienne Bergeron2016-04-2110-81/+36
| | | | | | | | | | | | | | | | Summary: Little cleanup to lift-out and to remove some frequently used ast-matchers. Some of theses matchers are candidates to be lifted to ASTMatchers.h. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19200 llvm-svn: 267003
* [Clang-tidy] Fix for crash in modernize-raw-string-literal checkAlexander Kornienko2016-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: Clang-tidy modernize-raw-string-literal check crashes on run-time assert while it is evaluating compiler predefined identifiers such as - __FUNCTION__ - __func__ - __PRETTY_FUNCTION__ Check is asserting because it cannot find opening quote for such string literal. It occurs only on debug build config. I think that it would be good to prune such cases by crossing off predefined expressions - there is no need to evaluate such matches. Reviewers: LegalizeAdulthood, alexfh Subscribers: cfe-commits Patch by Marek Jenda! Differential Revision: http://reviews.llvm.org/D19331 llvm-svn: 266992
* clang-tidy: [misc-unused-using-decls] Support template types.Daniel Jasper2016-04-201-3/+7
| | | | | | This fixes llvm.org/PR27429. llvm-svn: 266866
* clang-tidy: [misc-unused-using-decls] Always use the canonical decl toDaniel Jasper2016-04-202-5/+7
| | | | | | | | identify things. This fixes llvm.org/PR27430. llvm-svn: 266864
* Fix a crash in cppcoreguidelines-pro-type-member-init related to missing ↵Haojian Wu2016-04-201-6/+4
| | | | | | | | | | | | | | | | constructor bodies. Summary: Fixes a crash in cppcoreguidelines-pro-type-member-init when checking some record types with a constructor without a body. We now check to make sure the constructor has a body before looking for missing members and base initializers. Patch by Michael Miller! Reviewers: aaron.ballman, alexfh, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19270 llvm-svn: 266862
* [Clang-tidy] Fix extra semicolon warning in ↵Eugene Zelenko2016-04-191-2/+2
| | | | | | cppcoreguidelines/ProTypeMemberInitCheck.cpp. llvm-svn: 266795
* Initial version of misc-unused-using-decl check.Daniel Jasper2016-04-195-1/+120
| | | | llvm-svn: 266735
* [clang-tidy] readability-container-size-empty fixesGabor Horvath2016-04-191-8/+12
| | | | | | | | | | | | Summary: This patch fixes PR27410 and adds std::basic_string support. Reviewers: Eugene.Zelenko, hokein Subscribers: cfe-commits, o.gyorgy Differential Revision: http://reviews.llvm.org/D19262 llvm-svn: 266734
* Add missing override keyword to silence -Winconsistent-missing-override. NFCCraig Topper2016-04-161-1/+1
| | | | llvm-svn: 266511
* [clang-tidy] Add more detection rules for redundant c_str calls.Etienne Bergeron2016-04-151-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The string class contains methods which support receiving either a string literal or a string object. For example, calls to append can receive either a char* or a string. ``` string& append (const string& str); string& append (const char* s); ``` Which make these cases equivalent, and the .c_str() useless: ``` std::string s = "123"; str.append(s); str.append(s.c_str()); ``` In these cases, removing .c_str() doesn't provide any size or speed improvement. It's only a readability issue. If the string contains embedded NUL characters, the string literal and the string object won't produce the same semantic. Reviewers: alexfh, sbenza Subscribers: LegalizeAdulthood, aaron.ballman, chapuni, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D18475 llvm-svn: 266463
* [clang-tidy] Add new checker for suspicious sizeof expressionsEtienne Bergeron2016-04-154-0/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check is finding suspicious cases of sizeof expression. Sizeof expression is returning the size (in bytes) of a type or an expression. Programmers often abuse or misuse this expression. This checker is adding common set of patterns to detect some of these bad constructs. Some examples found by this checker: R/packages/ifultools/ifultools/src/fra_neig.c ``` /* free buffer memory */ (void) mutil_free( dist_buff, sizeof( ctr * sizeof( double ) ) ); (void) mutil_free( nidx_buff, sizeof( ctr * sizeof( sint32 ) ) ); ``` graphviz/v2_20_2/lib/common/utils.c ``` static Dtdisc_t mapDisc = { offsetof(item, p), sizeof(2 * sizeof(void *)), offsetof(item, link), (Dtmake_f) newItem, (Dtfree_f) freeItem, (Dtcompar_f) cmpItem, NIL(Dthash_f), NIL(Dtmemory_f), NIL(Dtevent_f) }; ``` mDNSResponder/mDNSShared/dnsextd.c ``` context = ( TCPContext* ) malloc( sizeof( TCPContext ) ); require_action( context, exit, err = mStatus_NoMemoryErr; LogErr( "AcceptTCPConnection", "malloc" ) ); mDNSPlatformMemZero( context, sizeof( sizeof( TCPContext ) ) ); context->d = self; ``` Reviewers: alexfh Subscribers: malcolm.parsons, Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19014 llvm-svn: 266451
* [clang-tidy] Add checker for operations between integrals and pointersEtienne Bergeron2016-04-154-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check is finding suspicious operations involving pointers and integral types; which are most likely bugs. Examples: subversion/v1_6/subversion/libsvn_subr/utf.c ``` static const char * fuzzy_escape(const char *src, apr_size_t len, apr_pool_t *pool) { [...] while (src_orig < src_end) { if (! svn_ctype_isascii(*src_orig) || src_orig == '\0') // Should be *src_orig { ``` apache2/v2_2_23/modules/metadata/mod_headers.c ``` static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa) { [...] tag->arg = '\0'; // ERROR: tag->arg has type char* /* grab the argument if there is one */ if (*s == '{') { ++s; tag->arg = ap_getword(p,&s,'}'); } ``` Reviewers: alexfh Subscribers: Eugene.Zelenko, cfe-commits Differential Revision: http://reviews.llvm.org/D19118 llvm-svn: 266450
* [clang-tidy] Add check misc-multiple-statement-macroSamuel Benzaquen2016-04-144-0/+147
| | | | | | | | | | | | | | | Summary: The check detects multi-statement macros that are used in unbraced conditionals. Only the first statement will be part of the conditionals and the rest will fall outside of it and executed unconditionally. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18766 llvm-svn: 266369
* Add support for type aliases to modernize-redundant-void-arg.cppAaron Ballman2016-04-142-11/+16
| | | | | | Patch by Clement Courbet. llvm-svn: 266358
* Complete support for C++ Core Guidelines Type.6: Always initialize a member ↵Alexander Kornienko2016-04-135-138/+442
| | | | | | | | | | | | | | | | variable. Summary: Added the remaining features needed to satisfy C++ Core Guideline Type.6: Always initialize a member variable to cppcoreguidelines-pro-type-member-init. The check now flags all default-constructed uses of record types without user-provided default constructors that would leave their memory in an undefined state. The check suggests value initializing them instead. Reviewers: flx, alexfh, aaron.ballman Subscribers: klimek, aaron.ballman, LegalizeAdulthood, cfe-commits Patch by Michael Miller! Differential Revision: http://reviews.llvm.org/D18584 llvm-svn: 266191
* [clang-tidy] Add a readability-deleted-default clang-tidy check.Alexander Kornienko2016-04-134-0/+109
| | | | | | | | | | | Checks if constructors and assignment operators that are marked '= default' are actually deleted by the compiler. Patch by Alex Pilkiewicz! Differential Revision: http://reviews.llvm.org/D18961 llvm-svn: 266190
* [clang-tidy] add_new_check.py should fail if check name starts with the ↵Alexander Kornienko2016-04-131-21/+30
| | | | | | | | module name + updated formatting llvm-svn: 266181
* [clang-tidy] fix readability-avoid-const-params-in-decls creating invalid ↵Matthias Gehre2016-04-121-7/+40
| | | | | | | | | | | | | | | | | | | | code in fix-its Summary: The Fix-Its for the added test cases were before: -void F11(const unsigned int /*version*/); +void F11(unsigned int int /*version*/); -void F12(const bool b = true); +void F12(_Bool true); Reviewers: fowles, hokein, sbenza, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18993 llvm-svn: 266044
* [clang-tidy] cppcoreguidelines-interfaces-global-initAlexander Kornienko2016-04-084-0/+98
| | | | | | | | | | | | | | | | Summary: This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems (this recommandation is part of CPP core guidelines). Note that this only checks half of the guideline for now (it does not enforce using constexpr functions). Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, etienneb, Eugene.Zelenko, cfe-commits Patch by Clement Courbet! Differential Revision: http://reviews.llvm.org/D18649 llvm-svn: 265774
* [clang-tidy] add new checker for string literal with NUL character.Etienne Bergeron2016-04-074-0/+122
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the support for detecting suspicious string literals and their //incorrect// usage. The following example shows a incorrect character escaping leading to an embedded NUL character. ``` std::string str = "\0x42"; // Should be "\x42". ``` The patch also add detection of truncated literal when a literal is passed to a string constructor. Reviewers: hokein, alexfh Subscribers: LegalizeAdulthood, bcraig, Eugene.Zelenko, bkramer, cfe-commits Differential Revision: http://reviews.llvm.org/D18783 llvm-svn: 265691
* [clang-tidy] fix a crash with -fdelayed-template-parsing in ↵Etienne Bergeron2016-04-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | UnnecessaryValueParamCheck. Summary: This is the same kind of bug than [[ http://reviews.llvm.org/D18238 | D18238 ]]. Fix crashes caused by deferencing null pointer when declarations parsing may be delayed. The body of the declarations may be null. The crashes were observed with a Windows build of clang-tidy and the following command-line. ``` command-line switches: -fms-compatibility-version=19 -fms-compatibility ``` Reviewers: alexfh Subscribers: kimgr, LegalizeAdulthood, cfe-commits Differential Revision: http://reviews.llvm.org/D18852 llvm-svn: 265681
* [clang-tidy] Remove unnecessary getName() on Decls and Types feeding into a ↵Benjamin Kramer2016-04-0710-43/+35
| | | | | | | | | | DiagnosticBuilder Going through a string removes some of the smarts of the diagnosic printer and makes the code more complicated. This change has some cosmetic impact on the output but that's mostly minor. llvm-svn: 265680
* [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.Etienne Bergeron2016-04-071-61/+87
| | | | | | | | | | | | | | | | | | Summary: In Release mode, the check was infinite looping over chromium code base. It seems there is something strange with the creation of the Maps. I believe the compiler is making some assumption with the implicit conversion from enum <-> int. By moving the map to a standard switch/cases, we no longer allocate memory and we can keep the same behavior. For a small amount of elements, this is fine. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18833 llvm-svn: 265679
OpenPOWER on IntegriCloud