Chromium Code Reviews| Index: tools/clang/plugins/FindBadConstructsConsumer.cpp |
| diff --git a/tools/clang/plugins/FindBadConstructsConsumer.cpp b/tools/clang/plugins/FindBadConstructsConsumer.cpp |
| index 3c12e9f50c77668ee862b6d27e778064c39eab45..c19b66b614a2f2829d5139513bb783c212b40399 100644 |
| --- a/tools/clang/plugins/FindBadConstructsConsumer.cpp |
| +++ b/tools/clang/plugins/FindBadConstructsConsumer.cpp |
| @@ -650,6 +650,7 @@ void FindBadConstructsConsumer::CountType(const Type* type, |
| TemplateName name = |
| dyn_cast<TemplateSpecializationType>(type)->getTemplateName(); |
| bool whitelisted_template = false; |
| + bool trivial_template = false; |
| // 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, |
| @@ -660,11 +661,17 @@ void FindBadConstructsConsumer::CountType(const Type* type, |
| // fix. https://bugs.chromium.org/p/chromium/issues/detail?id=663463 |
| if (TemplateDecl* decl = name.getAsTemplateDecl()) { |
| std::string base_name = decl->getNameAsString(); |
| - if (base_name == "basic_string" || base_name == "atomic_int") |
| + if (base_name == "basic_string") |
| whitelisted_template = true; |
| + else if (base_name == "__atomic_int" || base_name == "atomic_int" || |
| + base_name == "__atomic_base") { |
|
dcheng
2016/11/09 06:33:45
I'm wondering if we should just intercept this in
hans
2016/11/09 16:48:00
(Actually, the standard says atomic_int is either
palmer
2016/11/10 00:25:22
Done (and that resulted in a smaller diff, which i
|
| + trivial_template = true; |
| + } |
| } |
| - if (whitelisted_template) |
| + if (trivial_template) |
| + (*trivial_member)++; |
| + else if (whitelisted_template) |
| (*non_trivial_member)++; |
| else |
| (*templated_non_trivial_member)++; |