summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/format-arg-attribute.m
Commit message (Collapse)AuthorAgeFilesLines
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-261-3/+3
| | | | | | | | | | information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
* Improving the diagnostic for cases where the attribute only appertains to a ↵Aaron Ballman2015-11-041-3/+3
| | | | | | function with a prototype. llvm-svn: 252055
* Objective-C. Revert patch r193003 for furtherFariborz Jahanian2014-02-071-24/+4
| | | | | | internal discussions. // rdar://16006401 llvm-svn: 200986
* ObjectiveC. Added support for methods annotated with format_argFariborz Jahanian2013-10-181-4/+24
| | | | | | | attributes when such methods are actually envoked in message expression. // rdar://15242010 llvm-svn: 193003
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-231-3/+3
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180973
* Revert r180970; it's causing breakage.Douglas Gregor2013-05-021-1/+1
| | | | llvm-svn: 180972
* Use attribute argument information to determine when to parse attribute ↵Douglas Gregor2013-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arguments as expressions. This change partly addresses a heinous problem we have with the parsing of attribute arguments that are a lone identifier. Previously, we would end up parsing the 'align' attribute of this as an expression "(Align)": template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align((Align)))) char storage[Size]; }; while this would parse as a "parameter name" 'Align': template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align(Align))) char storage[Size]; }; The code that handles the alignment attribute would completely ignore the parameter name, so the while the first of these would do what's expected, the second would silently be equivalent to template<unsigned Size, unsigned Align> class my_aligned_storage { __attribute__((align)) char storage[Size]; }; i.e., use the maximal alignment rather than the specified alignment. Address this by sniffing the "Args" provided in the TableGen description of attributes. If the first argument is "obviously" something that should be treated as an expression (rather than an identifier to be matched later), parse it as an expression. Fixes <rdar://problem/13700933>. llvm-svn: 180970
* Pretty up the wrong-number-of-arguments-for-attribute diagnostic byJohn McCall2011-03-021-4/+4
| | | | | | | using a custom plural form. Split out the range diagnostics as their own message. llvm-svn: 126840
* Change the wording of the bad-decl-for-attribute warning and errorJohn McCall2011-01-251-3/+3
| | | | | | to make it clear that we're talking about the declarations and not the types. llvm-svn: 124175
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Change tests to use clang -cc1...Fariborz Jahanian2009-12-141-1/+1
| | | | llvm-svn: 91297
* Update test case; I don't really understand why packed enums changed this, butDaniel Dunbar2009-08-081-2/+1
| | | | | | the new havior is better so... llvm-svn: 78473
* implementation of format_arg for ObjC methods/functions.Fariborz Jahanian2009-05-201-0/+28
Still more to do. llvm-svn: 72173
OpenPOWER on IntegriCloud