Repository navigation
Commit 01c5ec4
Fix #15278 TemplateSimplifier: class templates nested in a namespace need one pass per level
expandTemplate adjusts the scope of a template usage in a copied body
with token_scope.find_last_of(" :: "), which finds the last space or
colon rather than the substring " :: ". "NS :: A1" becomes "NS ::", so
the new instantiation is named "NS :: :: A0", matches no declaration,
and waits for the next pass. Each level of nesting inside a namespace
costs one pass, and from 11 levels the 10-pass limit leaves the
innermost template uninstantiated.
Use rfind(" :: "), as getTemplateInstantiations does for the same
purpose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 35e76b5 commit 01c5ec4
2 files changed
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2301 | 2301 | | |
2302 | 2302 | | |
2303 | 2303 | | |
2304 | | - | |
| 2304 | + | |
2305 | 2305 | | |
2306 | 2306 | | |
2307 | 2307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| |||
5518 | 5519 | | |
5519 | 5520 | | |
5520 | 5521 | | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
| 5544 | + | |
| 5545 | + | |
| 5546 | + | |
| 5547 | + | |
| 5548 | + | |
| 5549 | + | |
| 5550 | + | |
| 5551 | + | |
| 5552 | + | |
| 5553 | + | |
| 5554 | + | |
| 5555 | + | |
| 5556 | + | |
| 5557 | + | |
| 5558 | + | |
| 5559 | + | |
| 5560 | + | |
| 5561 | + | |
| 5562 | + | |
| 5563 | + | |
| 5564 | + | |
| 5565 | + | |
| 5566 | + | |
5521 | 5567 | | |
5522 | 5568 | | |
5523 | 5569 | | |
| |||
0 commit comments