<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I'm working on a clang-tidy checker, and I want to be able to evaluate a static condition on a class I'm matching, do you know if that's possible? </div><div>I have a templated integral_constant<bool, my_condition<T>>, and I want to know the value for a given T. In more accurate details, here's the code:</div><div><br></div><div>In the application code:</div><div><div>typedef std::integral_constant<bool, sizeof(MyCondition<T>(</div><div>                                             static_cast<const T*>(0))) ==</div><div>                                             sizeof(char)></div><div>        my_great_condition;</div><div><br></div><div>In the clang checker:</div><div><br></div><div><div>bool IsTypeWithMyCondition(const clang::QualType &type,</div><div>                       const MatchFinder::MatchResult &result) {</div><div>  return !ast_matchers::match(</div><div>              qualType(</div><div>                  hasUnqualifiedDesugaredType(recordType(hasDeclaration(</div><div>                      cxxRecordDecl(isDerivedFrom("::MyBaseClass"))))))</div><div>                  .bind("type"),</div><div>              type, *result.Context)</div><div>              .empty();</div><div>}</div></div><div><br></div><div>I would like to additionally match that my_great_condition<type> evaluates to true. Do you know how I can achieve that?</div><div><br></div><div>Thanks,</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Valentin Tolmer</div></div></div></div></div></div></div>