diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaCXX/cxx11-gnu-attrs.cpp | 1 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/arc-nsconsumed-errors.mm | 4 | ||||
-rw-r--r-- | clang/test/SemaObjCXX/arc-templates.mm | 8 |
3 files changed, 11 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/cxx11-gnu-attrs.cpp b/clang/test/SemaCXX/cxx11-gnu-attrs.cpp index d20617815e6..231be727714 100644 --- a/clang/test/SemaCXX/cxx11-gnu-attrs.cpp +++ b/clang/test/SemaCXX/cxx11-gnu-attrs.cpp @@ -19,6 +19,7 @@ int *[[gnu::unused]] attr_on_ptr; [[gnu::fastcall]] void pr17424_4() [[gnu::stdcall]]; // expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} // expected-warning@-2 {{attribute 'stdcall' ignored, because it cannot be applied to a type}} +// expected-warning@-3 {{calling convention 'stdcall' ignored for this target}} void pr17424_5 [[gnu::fastcall]](); // expected-warning@-1 {{calling convention 'fastcall' ignored for this target}} diff --git a/clang/test/SemaObjCXX/arc-nsconsumed-errors.mm b/clang/test/SemaObjCXX/arc-nsconsumed-errors.mm index c78d8a5f4ad..638a1ebd2ad 100644 --- a/clang/test/SemaObjCXX/arc-nsconsumed-errors.mm +++ b/clang/test/SemaObjCXX/arc-nsconsumed-errors.mm @@ -29,9 +29,9 @@ void releaser(__attribute__((ns_consumed)) id); releaser_t r2 = releaser; // no-warning template <typename T> -void templateFunction(T) { } // expected-note {{candidate template ignored: could not match 'void (__strong id)' against 'void (id)'}} \ +void templateFunction(T) { } // expected-note {{candidate template ignored: could not match 'void (__strong id)' against 'void (__attribute__((ns_consumed)) id)'}} \ // expected-note {{candidate template ignored: failed template argument deduction}} -releaser_t r3 = templateFunction<id>; // expected-error {{address of overloaded function 'templateFunction' does not match required type 'void (id)'}} +releaser_t r3 = templateFunction<id>; // expected-error {{address of overloaded function 'templateFunction' does not match required type 'void (__attribute__((ns_consumed)) id)'}} template <typename T> void templateReleaser(__attribute__((ns_consumed)) T) { } // expected-note 2{{candidate template ignored: failed template argument deduction}} diff --git a/clang/test/SemaObjCXX/arc-templates.mm b/clang/test/SemaObjCXX/arc-templates.mm index 81425985e62..97854dff8c1 100644 --- a/clang/test/SemaObjCXX/arc-templates.mm +++ b/clang/test/SemaObjCXX/arc-templates.mm @@ -442,3 +442,11 @@ namespace produced_nested { take_no(produces<4>::fn); // expected-error {{no matching function}} } } + +namespace instantiate_consumed { + template <class T> void take(CONSUMED T t) {} // expected-note {{candidate template ignored: substitution failure [with T = int]: ns_consumed attribute only applies to Objective-C object parameters}} + void test() { + take((id) 0); + take((int) 0); // expected-error {{no matching function for call to 'take'}} + } +} |