| Index: tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| index 00d4cb9a2316e42dbffd147d21ce93e418c0b867..636261b3db3553abd7a2ac248fc80b80d1984ec3 100644
|
| --- a/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| +++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp
|
| @@ -653,7 +653,7 @@ void FindBadConstructsConsumer::CountType(const Type* type,
|
|
|
| // HACK: I'm at a loss about how to get the syntax checker to get
|
| // whether a template is externed or not. For the first pass here,
|
| - // just do retarded string comparisons.
|
| + // just do simple string comparisons.
|
| if (TemplateDecl* decl = name.getAsTemplateDecl()) {
|
| std::string base_name = decl->getNameAsString();
|
| if (base_name == "basic_string")
|
| @@ -675,7 +675,15 @@ void FindBadConstructsConsumer::CountType(const Type* type,
|
| }
|
| case Type::Typedef: {
|
| while (const TypedefType* TT = dyn_cast<TypedefType>(type)) {
|
| - type = TT->getDecl()->getUnderlyingType().getTypePtr();
|
| + if (auto* decl = TT->getDecl()) {
|
| + const std::string name = decl->getNameAsString();
|
| + auto* context = decl->getDeclContext();
|
| + if (name == "atomic_int" && context->isStdNamespace()) {
|
| + (*trivial_member)++;
|
| + return;
|
| + }
|
| + type = decl->getUnderlyingType().getTypePtr();
|
| + }
|
| }
|
| CountType(type,
|
| trivial_member,
|
|
|