diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-28 00:03:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-28 00:03:10 +0000 |
commit | 93d6b07cd79d74e343d81c0e8fb5365376a33097 (patch) | |
tree | 83228486bce06c1ebd55784eb9bdef9970df55b0 /test | |
parent | ab2d09b6287a5dc6fa94d78739444f46f9a78bfb (diff) |
Fold together the two implementations of 6.7.3p2 in SemaType. Fix two bugs, each of which was only present in one version:
* Give the right diagnostic for 'restrict' applied to a non-pointer, non-reference type.
* Don't reject 'restrict' applied indirectly to an Objective-C object pointer type (eg, through template instantiation).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaObjCXX/parameters.mm | 3 | ||||
-rw-r--r-- | test/SemaTemplate/fun-template-def.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/SemaObjCXX/parameters.mm b/test/SemaObjCXX/parameters.mm index 1a7869dc7a..363675a0dd 100644 --- a/test/SemaObjCXX/parameters.mm +++ b/test/SemaObjCXX/parameters.mm @@ -15,3 +15,6 @@ struct test2 { virtual void foo() = 0; }; // expected-note {{unimplemented}} @interface Test2 - (void) foo: (test2) foo; // expected-error {{parameter type 'test2' is an abstract class}} @end + +template<typename T> void r1(__restrict T); +void r2(__restrict id x) { r1(x); } diff --git a/test/SemaTemplate/fun-template-def.cpp b/test/SemaTemplate/fun-template-def.cpp index f57a045649..2d515b4b15 100644 --- a/test/SemaTemplate/fun-template-def.cpp +++ b/test/SemaTemplate/fun-template-def.cpp @@ -48,7 +48,7 @@ T f1(T t1, U u1, int i1) } template<typename T> -void f2(__restrict T x) {} // expected-note {{substitution failure [with T = int]: pointer to function type 'int' may not be 'restrict' qualified}} +void f2(__restrict T x) {} // expected-note {{substitution failure [with T = int]: restrict requires a pointer or reference ('int' is invalid}} void f3() { f2<int*>(0); |