Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Allow comparisons between different ms ptr size address space …
…types. We're currently using address spaces to implement __ptr32/__ptr64 attributes; this patch fixes a bug where clang doesn't allow types with different pointer size attributes to be compared. Fixes https://bugs.llvm.org/show_bug.cgi?id=51889 Differential Revision: https://reviews.llvm.org/D110670
- Loading branch information
Showing
3 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// RUN: %clang_cc1 -triple i686-windows %s -fsyntax-only -Wmicrosoft -verify -fms-extensions | ||
// RUN: %clang_cc1 -triple x86_64-windows %s -fsyntax-only -Wmicrosoft -verify -fms-extensions | ||
// expected-no-diagnostics | ||
|
||
// Check that __ptr32/__ptr64 can be compared. | ||
int test_ptr_comparison(int *__ptr32 __uptr p32u, int *__ptr32 __sptr p32s, | ||
int *__ptr64 p64) { | ||
return (p32u == p32s) + | ||
(p32u == p64) + | ||
(p32s == p64); | ||
} |