diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-06-04 00:15:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-06-04 00:15:09 +0000 |
commit | 5bee25884b9b7aec2f1628c6bc0604e7550a30ad (patch) | |
tree | b0aa9f39adbbc43b6cbe62a19c30df086794b5e8 /clang/test/SemaCXX/overloaded-builtin-operators.cpp | |
parent | 34b9c511c1f0d9a5ffc1df34149b7cf5e3a14a88 (diff) | |
download | bcm5719-llvm-5bee25884b9b7aec2f1628c6bc0604e7550a30ad.tar.gz bcm5719-llvm-5bee25884b9b7aec2f1628c6bc0604e7550a30ad.zip |
When adding built-in operator candidates for overload resolution
involving 'restrict', place restrict on the pointer type rather than
on the pointee type. Also make sure that we gather restrict from the
pointer type. Fixes PR12854 and the major part of PR11093.
llvm-svn: 157910
Diffstat (limited to 'clang/test/SemaCXX/overloaded-builtin-operators.cpp')
-rw-r--r-- | clang/test/SemaCXX/overloaded-builtin-operators.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/overloaded-builtin-operators.cpp b/clang/test/SemaCXX/overloaded-builtin-operators.cpp index b3c08085a69..6de4f64030a 100644 --- a/clang/test/SemaCXX/overloaded-builtin-operators.cpp +++ b/clang/test/SemaCXX/overloaded-builtin-operators.cpp @@ -237,3 +237,22 @@ namespace PR7851 { (void)(x - x); } } + +namespace PR12854 { + enum { size = 1 }; + void plus_equals() { + int* __restrict py; + py += size; + } + + struct RestrictInt { + operator int* __restrict &(); + }; + + void user_conversions(RestrictInt ri) { + ++ri; + --ri; + ri++; + ri--; + } +} |