llvm-project/clang-tools-extra/clang-tidy/hicpp
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
..
CMakeLists.txt [Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy in source code headers. 2018-09-20 00:02:55 +00:00
ExceptionBaseclassCheck.cpp [clang-tidy] fix PR37913, templated exception factory diagnosed correctly 2018-09-17 13:55:10 +00:00
ExceptionBaseclassCheck.h Add hicpp-exception-baseclass to the HIC++ module. 2017-08-11 16:31:51 +00:00
HICPPTidyModule.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
LICENSE.TXT
MultiwayPathsCoveredCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
MultiwayPathsCoveredCheck.h [clang-tidy] Resubmit hicpp-multiway-paths-covered without breaking test 2018-03-21 15:34:15 +00:00
NoAssemblerCheck.cpp [tidy] Move private ast matchers into anonymous namespaces to avoid ODR conflicts. 2018-02-18 19:02:35 +00:00
NoAssemblerCheck.h
SignedBitwiseCheck.cpp Port getLocStart -> getBeginLoc 2018-08-09 22:42:26 +00:00
SignedBitwiseCheck.h [clang-tidy] hicpp bitwise operations on signed integers 2017-08-30 13:32:05 +00:00