blob: 547990c09a4c071ca1cea6d6f499395e3d063440 [file] [log] [blame]
// Part of the Crubit project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "rs_bindings_from_cc/ast_util.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/Basic/LLVM.h"
namespace crubit {
bool IsFullClassTemplateSpecializationOrChild(const clang::Decl* decl) {
if (clang::isa<clang::ClassTemplatePartialSpecializationDecl>(decl)) {
return false;
}
if (clang::isa<clang::ClassTemplateSpecializationDecl>(decl)) {
return true;
}
if (const auto* decl_context = decl->getDeclContext()) {
return IsFullClassTemplateSpecializationOrChild(
clang::dyn_cast<clang::Decl>(decl_context));
}
return false;
}
} // namespace crubit