diff options
author | Francois Pichet <pichet2000@gmail.com> | 2012-04-16 04:08:35 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2012-04-16 04:08:35 +0000 |
commit | 0066db90394ee6153e3f4f0c8ab21acadc8932e1 (patch) | |
tree | 78b92e8082319bc309572c93ab8ca9ccbbe2a180 /clang/test/Parser/MicrosoftExtensions.cpp | |
parent | 7f1ff60021c534cef6372c693b42498fd34bde3c (diff) | |
download | bcm5719-llvm-0066db90394ee6153e3f4f0c8ab21acadc8932e1.tar.gz bcm5719-llvm-0066db90394ee6153e3f4f0c8ab21acadc8932e1.zip |
The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
error: non-type template argument of type 'const _GUID *' is not a constant expression
For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };
llvm-svn: 154790
Diffstat (limited to 'clang/test/Parser/MicrosoftExtensions.cpp')
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index 89394c303ca..c6b3dfd691a 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions -fdelayed-template-parsing +// RUN: %clang_cc1 %s -std=c++11 -fsyntax-only -Wno-unused-value -Wmicrosoft -verify -fms-extensions -fdelayed-template-parsing /* Microsoft attribute tests */ [repeatable][source_annotation_attribute( Parameter|ReturnValue )] @@ -103,7 +103,7 @@ 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; +typedef COM_CLASS_TEMPLATE_REF<struct_with_uuid, __uuidof(struct_with_uuid)> COM_TYPE_REF; struct late_defined_uuid; template<typename T> |