diff --git a/CHANGELOG.md b/CHANGELOG.md index cf8c0e6c..071b30f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Fix `Parser` handling of `template` specialization and their `friend` declarations ([pull #733](https://github.com/bytedeco/javacpp/pull/733)) * Improve `Parser` capabilities for `operator` and function templates ([pull #732](https://github.com/bytedeco/javacpp/pull/732)) * Fix `Parser` failing on nested initializer lists and on attributes found inside `enum` declarations * Fix `Parser` for basic containers like `std::optional >` ([issue #718](https://github.com/bytedeco/javacpp/issues/718)) diff --git a/src/main/java/org/bytedeco/javacpp/tools/Parser.java b/src/main/java/org/bytedeco/javacpp/tools/Parser.java index b07c694d..ac0302e1 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Parser.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Parser.java @@ -1406,11 +1406,15 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole // template arguments Type[] types = templateArguments(context); dcl.cppName += "<"; - for (int i = 0; i 0) dcl.cppName += ","; + for (int i = 0; i < types.length; i++) { + if (i > 0) { + dcl.cppName += ","; + } dcl.cppName += types[i].cppName; } - if (dcl.cppName.endsWith(">")) dcl.cppName += " "; + if (dcl.cppName.endsWith(">")) { + dcl.cppName += " "; + } dcl.cppName += ">"; } else if (token.match(Token.IDENTIFIER) && (dcl.cppName.length() == 0 || dcl.cppName.endsWith("::"))) { @@ -1659,7 +1663,7 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole // pick the Java name from the InfoMap if appropriate String originalName = fieldPointer ? groupInfo.pointerTypes[0] : dcl.javaName; if (attr == null && defaultName == null && info != null && info.javaNames != null && info.javaNames.length > 0 - && (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) { + && (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) { dcl.javaName = info.javaNames[0]; }