llvm-project/clang-tools-extra/clang-tidy/utils
Roman Lebedev b2eec586c8 [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)
Summary:
Detects when the integral literal or floating point (decimal or hexadecimal)
literal has non-uppercase suffix, and suggests to make the suffix uppercase,
with fix-it.

All valid combinations of suffixes are supported.

```
  auto x = 1;  // OK, no suffix.

  auto x = 1u; // warning: integer literal suffix 'u' is not upper-case

  auto x = 1U; // OK, suffix is uppercase.

  ...
```

References:
* [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]]
* MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix
* MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D52670

llvm-svn: 344755
2018-10-18 20:06:40 +00:00
..
ASTUtils.cpp [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4) 2018-10-18 20:06:40 +00:00
ASTUtils.h [clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4) 2018-10-18 20:06:40 +00:00
CMakeLists.txt [clangtidy] Remove old copy of ExprMutationAnalyzer 2018-09-11 22:59:46 +00:00
DeclRefExprUtils.cpp [clang-tidy] Do not trigger move fix for non-copy assignment operators in performance-unnecessary-value-param check 2017-01-19 15:51:10 +00:00
DeclRefExprUtils.h [clang-tidy] Handle constructors in performance-unnecessary-value-param 2017-01-03 12:10:44 +00:00
ExprSequence.cpp [clang-tidy] Sequence statements with multiple parents correctly (PR39149) 2018-10-04 11:36:39 +00:00
ExprSequence.h [clang-tidy] Sequence statements with multiple parents correctly (PR39149) 2018-10-04 11:36:39 +00:00
FixItHintUtils.cpp [clang-tidy] NFC refactor lexer-utils to be usable without ASTContext 2018-10-05 14:15:19 +00:00
FixItHintUtils.h [clang-tidy] Fix doxygen errors. NFC. 2016-06-17 11:43:33 +00:00
HeaderFileExtensionsUtils.cpp [clang-tidy] Some tweaks on header guard checks. 2016-08-26 11:15:38 +00:00
HeaderFileExtensionsUtils.h [clang-tidy] Unify the way IncludeStyle and HeaderFileExtesions options are used 2017-07-20 12:02:03 +00:00
HeaderGuard.cpp Spelling mistakes in comments. NFCI. 2017-03-30 13:10:33 +00:00
HeaderGuard.h [clang-tidy] Unify the way IncludeStyle and HeaderFileExtesions options are used 2017-07-20 12:02:03 +00:00
IncludeInserter.cpp Reland "[tools] Updating PPCallbacks::InclusionDirective calls" 2018-05-10 19:13:14 +00:00
IncludeInserter.h [clang-tidy] Fix doxygen errors. NFC. 2016-06-17 11:43:33 +00:00
IncludeSorter.cpp Correctly classify main file includes if there is a prefix added 2017-01-12 15:31:50 +00:00
IncludeSorter.h [clang-tidy] More doc fixes. NFC. 2016-06-17 12:01:15 +00:00
LexerUtils.cpp [clang-tidy] NFC refactor lexer-utils to be usable without ASTContext 2018-10-05 14:15:19 +00:00
LexerUtils.h [clang-tidy] NFC refactor lexer-utils to be usable without ASTContext 2018-10-05 14:15:19 +00:00
Matchers.h [clang-tidy] White List Option for performance-unnecessary-value-param, performance-unnecessary-copy-initialization and performance-for-range-copy 2018-10-12 13:05:21 +00:00
NamespaceAliaser.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
NamespaceAliaser.h Recommit "[ClangTidy] Add UsingInserter and NamespaceAliaser" 2016-10-17 08:33:59 +00:00
OptionsUtils.cpp [clang-tidy] Lift parsing of sequence of names functions to utils. 2016-05-10 15:31:15 +00:00
OptionsUtils.h [clang-tidy] More doc fixes. NFC. 2016-06-17 12:01:15 +00:00
TypeTraits.cpp [clang-tidy] ObjC ARC objects should not trigger performance-unnecessary-value-param 2018-02-02 15:34:33 +00:00
TypeTraits.h [clang-tidy] UnnecessaryValueParamCheck - suggest std::move() if non-const value parameter can be moved. 2016-07-01 20:12:15 +00:00
UsingInserter.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
UsingInserter.h Recommit "[ClangTidy] Add UsingInserter and NamespaceAliaser" 2016-10-17 08:33:59 +00:00