diff options
Diffstat (limited to 'test/SemaCXX/ms-uuid.cpp')
-rw-r--r-- | test/SemaCXX/ms-uuid.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/SemaCXX/ms-uuid.cpp b/test/SemaCXX/ms-uuid.cpp index e29dda878e680..624ac0541db46 100644 --- a/test/SemaCXX/ms-uuid.cpp +++ b/test/SemaCXX/ms-uuid.cpp @@ -1,4 +1,5 @@ // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s -Wno-deprecated-declarations +// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify -fms-extensions %s -Wno-deprecated-declarations typedef struct _GUID { unsigned long Data1; @@ -23,7 +24,7 @@ namespace { // clang-cl implements the following simpler (but largely compatible) behavior // instead: // * [] and __declspec uuids have the same behavior. -// * If there are several uuids on a a class (no matter if on the same decl or +// * If there are several uuids on a class (no matter if on the same decl or // on several decls), it is an error if they don't match. // * Having several uuids that match is ok. @@ -92,4 +93,16 @@ class __declspec(uuid("000000A0-0000-0000-C000-000000000049")) // the previous case). [uuid("000000A0-0000-0000-C000-000000000049"), uuid("000000A0-0000-0000-C000-000000000049")] class C10; + +template <const GUID* p> +void F1() { + // Regression test for PR24986. The given GUID should just work as a pointer. + const GUID* q = p; +} + +void F2() { + // The UUID should work for a non-type template parameter. + F1<&__uuidof(C1)>(); +} + } |