diff options
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 8 | ||||
-rw-r--r-- | test/Parser/MicrosoftExtensions.cpp | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index d5d1fcbb84..677b6f3560 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -3106,9 +3106,13 @@ CheckTemplateArgumentAddressOfObjectOrFunction(Sema &S, 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(); diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index decd57510f..32ed375889 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/test/Parser/MicrosoftExtensions.cpp @@ -101,6 +101,9 @@ class COM_CLASS_TEMPLATE { }; 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 { |