[cfe-commits] [PATCH][MS][Review request] - Late Microsoft template parsing
Francois Pichet
pichet2000 at gmail.com
Sun Mar 13 23:07:19 PDT 2011
Hi,
This patch implements "Late template parsing" in Microsoft mode.
It solves the problem of Microsoft allowing names not yet declared in
template code
Like this:
template <class T>
void foo() {
undeclared();
}
void undeclared(){
}
To do so, template function code and template explicit instantiations
are lexed, the tokens saved and actually parsed at the end of the
translation unit.
This resolve a bunch of error when parsing Microsoft C++ template code
with clang.
Important point: I tested that this patch can self host clang (on
Darwin) with -fms-extension enabled and it works:
make CXXFLAGS=-fms-extensions
cd tools/clang
make test
100% pass
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LateParsedMSTemplate.patch
Type: application/octet-stream
Size: 16650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110314/dd6e3887/attachment.obj>
More information about the cfe-commits
mailing list