[ClangAstDumper] Adds case when qualified prefix is anonymous
@@ -498,11 +498,19 @@ const std::string clava::getQualifiedPrefix(const NamedDecl *D) {
const std::string declName = D->getDeclName().getAsString();
//llvm::errs() << "QUALIFIED NAME: " << qualifiedName << "\n";
//llvm::errs() << "DECL NAME: " << declName << "\n";
+
+ // If declName is empty, return empty string
+ if(declName.empty()) {
+ return "";
+ }
+
// If declName is the same as the qualified name, return empty string
if(declName == qualifiedName) {
return "";
}
+
+
// Remove decl name and :: from qualified name
const std::string expectedSuffix = "::" + declName;
if(!endsWith(qualifiedName, expectedSuffix)) {
