[clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.
authorEtienne Bergeron <etienneb@google.com>
Thu, 7 Apr 2016 14:52:52 +0000 (14:52 +0000)
committerEtienne Bergeron <etienneb@google.com>
Thu, 7 Apr 2016 14:52:52 +0000 (14:52 +0000)
commit53f7c0ea8e02e2a49f13e713ec6bdbfe067e8383
treed8e08212b3d22601042d12c70636df0c955f49f0
parentd37630e461cb6e1db4fdf221f6ff978c8d7b0bc1
[clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.

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
clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp