[clang-tidy] Fix the potential infinite loop in recordIsTriviallyDefaultConstructible.

Summary:
The recordIsTriviallyDefaultConstructible may cause an infinite loop when
running on an ill-formed decl.

Reviewers: gribozavr

Subscribers: nemanjai, xazax.hun, kbarton, cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@370200 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed