[clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.
authorEtienne Bergeron <etienneb@google.com>
Thu, 7 Apr 2016 14:58:13 +0000 (14:58 +0000)
committerEtienne Bergeron <etienneb@google.com>
Thu, 7 Apr 2016 14:58:13 +0000 (14:58 +0000)
commit2c82ebe813c5f851852bdf4451a34f1d5dfe473c
treec4ace5dd02e678753a0f549c432e16d376e5a5b1
parenta62e2232815e537952bd6df271763521a0472498
[clang-tidy] fix a crash with -fdelayed-template-parsing in 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-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-delayed.cpp [new file with mode: 0644]