Commit 4a1a6b4
fix: strip MSVC elaborated type specifiers from extracted type names
MSVC's __FUNCSIG__ prepends 'struct ' or 'class ' to type names when
there is no explicit scope qualifier (e.g. anonymous-namespace types
may appear as 'struct child_table_cascade' rather than
'`anonymous-namespace'::child_table_cascade').
When rfind("::") returns npos (no scope to strip), the full string
including 'struct '/'class ' was used as the table/column name,
producing e.g. CREATE TABLE struct child_table_cascade.
Fix: strip the elaborated type keyword prefix immediately after
substring extraction, before the scope-stripping and _tag-suffix
steps. Applied to both tag_to_column_name (column_field.hpp) and
extract_type_name (schema_generator.hpp). GCC/Clang are unaffected
since their __PRETTY_FUNCTION__ output never includes these keywords.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 30d60d6 commit 4a1a6b4
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
221 | 228 | | |
222 | 229 | | |
223 | 230 | | |
| |||
0 commit comments