[cfe-dev] Handling legacy VC++ deficiencies

David Robins llvm at davidrobins.net
Tue Aug 28 06:35:46 PDT 2012


Visual Studio 2005 generated a lot of code that uses unqualified
pointers to member functions (think MFC dispatch tables; fear and
loathing, sure, but the code is out there), and even 2012 supports them,
although it now generates fully-qualified names ("&Class::Function", vs.
accepting "Function" without "&" or "Class::"). I understand C++
requires a qualified name; on the other hand, I want to compile this
corpus of legacy code with Clang (for analysis, not building).

Another issue in such legacy code is expecting inheritance of typedefs
in templates, whereas the standard requires redeclaring them explicitly
(e.g., types like value_type and pointer).

I remember seeing in another email that Clang does not want to be "bug
for bug compatible" with MSVC (and in yet another support for the bug
where VS 2005 eats a comma in varargs macros); what's the best way to
support compiling legacy code? Is it to be entirely unsupported? Can a
plugin do it? Or will changes restricted to particular Microsoft compiler
emulation (-fmsc-ver) be accepted?



More information about the cfe-dev mailing list