From 82f2dd2a393620236683e8759ef7cf3c0191c057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Guillemet?= Date: Tue, 2 Jan 2024 10:14:08 +0100 Subject: [PATCH] Untemplate class name before adding them to infoMap --- src/main/java/org/bytedeco/javacpp/tools/Parser.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bytedeco/javacpp/tools/Parser.java b/src/main/java/org/bytedeco/javacpp/tools/Parser.java index 05d669bf..f4dfe088 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Parser.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Parser.java @@ -3657,7 +3657,10 @@ boolean group(Context context, DeclarationList declList) throws ParserException if (type.javaName.length() > 0 && context.javaName != null) { type.javaName = context.javaName + "." + type.javaName; } - infoMap.put(info = new Info(type.cppName).pointerTypes(type.javaName)); + // Adding this info allows proper ns resolution for next declarations, but + // we don't want it to trigger template instantiation, so we untemplate the + // name first. + infoMap.put(info = new Info(Templates.strip(type.cppName)).pointerTypes(type.javaName)); } /* Propagate the need for downcasting from base classes */