Skip to content

Commit 4a0b916

Browse files
committed
prevent stripping a type from "const " if it doesn't have a "const " prefix
1 parent 45ede21 commit 4a0b916

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cling/src/core/foundation/src/TClassEdit.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,10 @@ static void ResolveTypedefImpl(const char *tname,
14251425
if (!scoperesult.empty()) {
14261426
// and it is a typedef
14271427
if (modified) {
1428-
if (constprefix && scoperesult.compare(0,6,"const ",6) != 0) mod_start_of_type -= 6;
1428+
if (constprefix && scoperesult.compare(0,6,"const ",6) != 0 && \
1429+
6 <= mod_start_of_type && result.compare(mod_start_of_type-6, 6, "const ")) {
1430+
mod_start_of_type -= 6;
1431+
}
14291432
result.replace(mod_start_of_type, string::npos,
14301433
scoperesult);
14311434
result += "::";

0 commit comments

Comments
 (0)