[cfe-commits] r130491 - in /cfe/trunk: lib/Sema/SemaTemplate.cpp test/Parser/MicrosoftExtensions.cpp
Francois Pichet
pichet2000 at gmail.com
Fri Apr 29 02:08:14 PDT 2011
Author: fpichet
Date: Fri Apr 29 04:08:14 2011
New Revision: 130491
URL: http://llvm.org/viewvc/llvm-project?rev=130491&view=rev
Log:
r130381 follow up: accept __uuidof expression for template argument reference.
Modified:
cfe/trunk/lib/Sema/SemaTemplate.cpp
cfe/trunk/test/Parser/MicrosoftExtensions.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=130491&r1=130490&r2=130491&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Fri Apr 29 04:08:14 2011
@@ -3106,9 +3106,13 @@
AddressTaken = true;
AddrOpLoc = UnOp->getOperatorLoc();
}
- } else
+ } else {
+ if (S.getLangOptions().Microsoft && isa<CXXUuidofExpr>(Arg)) {
+ Converted = TemplateArgument(ArgIn);
+ return false;
+ }
DRE = dyn_cast<DeclRefExpr>(Arg);
-
+ }
if (!DRE) {
S.Diag(Arg->getLocStart(), diag::err_template_arg_not_decl_ref)
<< Arg->getSourceRange();
Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=130491&r1=130490&r2=130491&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Fri Apr 29 04:08:14 2011
@@ -101,6 +101,9 @@
typedef COM_CLASS_TEMPLATE<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE_1;
typedef COM_CLASS_TEMPLATE<struct_with_uuid> COM_TYPE_2;
+template <class T, const GUID& g>
+class COM_CLASS_TEMPLATE_REF { };
+typedef COM_CLASS_TEMPLATE<struct_with_uuid, __uuidof(struct_with_uuid)> COM_TYPE_REF;
class CtorCall {
More information about the cfe-commits
mailing list