LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 13444 - [Windows] Wrong mangling of "const char * const *"
Summary: [Windows] Wrong mangling of "const char * const *"
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P enhancement
Assignee: Timur Iskhodzhanov
URL:
Keywords:
Depends on:
Blocks: 12477
  Show dependency tree
 
Reported: 2012-07-24 09:41 PDT by Timur Iskhodzhanov
Modified: 2012-09-03 04:21 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Iskhodzhanov 2012-07-24 09:41:16 PDT
The mangling is broken when using `-cxx-abi microsoft`:
$ cat const_arrays.cpp
extern const char* const* global;
// CHECK: "\01?global@@3PBQBDB"
//   NOW: "\01?global@@3PQBDA"
// Probably related to PR13182

void foo(const char* const* arg) {
// CHECK: "\01?foo@@YAXPBQBD@Z"
//   NOW: "\01?foo@@YAXPQBD@Z"
// Probably UN-related to PR13182
  if (global[0]) arg++;
}
Comment 1 João Matos 2012-07-24 10:27:43 PDT
Are you working on this Timur?
Comment 2 Timur Iskhodzhanov 2012-07-24 10:30:26 PDT
Not yet.
This affects only one file of my current 500+-files target :)
Feel free to take over if you want.
Comment 3 Timur Iskhodzhanov 2012-07-24 10:31:36 PDT
If you do take over - please pay more attention to the `foo` mangling as half of the `global` mangling problem will be solved by my PR13182 patch
Comment 4 Timur Iskhodzhanov 2012-08-23 09:23:18 PDT
One more possibly related test:

void foo(const unsigned int) {}
// CHECK: "\01?foo@@YAXI@Z"
//   NOW: "\01?foo@@YAXBI@Z"
Comment 5 Timur Iskhodzhanov 2012-08-23 09:32:25 PDT
More tests:

void foo(const double) {}
// CHECK: "\01?foo@@YAXN@Z"
//   NOW: "\01?foo@@YAXBN@Z"

typedef double Vector[3];
void foo(const Vector) {}
// CHECK: "\01?foo@@YAXQBN@Z"
//   NOW: "\01?foo@@YAXBQAN@Z"

void foo(Vector*, const Vector, const double) {}
// CHECK: "\01?foo@@YAXPAY02NQBNN@Z"
//   NOW: "\01?foo@@YAXPAY02NBQANBN@Z"

void foo(Vector*) {}
// CHECK: "\01?foo@@YAXPAY02N@Z"
//   NOW: "\01?foo@@YAXPAY02N@Z"
// The last one is correct now
Comment 6 Timur Iskhodzhanov 2012-08-24 09:39:06 PDT
Taking this
Comment 7 Timur Iskhodzhanov 2012-08-29 11:16:18 PDT
Good news: I think I've fixed all these issues.
I'll need to clean up the code (comments, mostly) before sending it for a review though.
Comment 8 João Matos 2012-08-29 11:37:40 PDT
Thanks for the update. I'll be happy to help review the patch once you post it.
Comment 9 Timur Iskhodzhanov 2012-09-03 04:16:01 PDT
Should be fixed by r163110.
Comment 10 Timur Iskhodzhanov 2012-09-03 04:21:53 PDT
... and added more tests in r163111.