summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/attr-availability.c
Commit message (Collapse)AuthorAgeFilesLines
* Parse: Diagnose malformed 'message' arguments for 'availability' attrDavid Majnemer2014-07-181-0/+2
| | | | | | | The parsing code for 'availability' wasn't prepared for string literals like "a" L"b" showing up. Error if this occurs. llvm-svn: 213350
* As Aaron pointed out it's simpler to reject wide string availability attr ↵Benjamin Kramer2013-09-131-0/+2
| | | | | | messages in the parser. llvm-svn: 190706
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-171-1/+1
| | | | llvm-svn: 168267
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Add ability to supply additional message to availability macros,Fariborz Jahanian2011-12-101-0/+8
| | | | | | // rdar://10095131 llvm-svn: 146304
* Add a __has_feature check for the 'availability' attributeDouglas Gregor2011-03-261-0/+5
| | | | llvm-svn: 128337
* Extend the new 'availability' attribute with support for anDouglas Gregor2011-03-261-0/+6
| | | | | | | 'unavailable' argument, which specifies that the declaration to which the attribute appertains is unavailable on that platform. llvm-svn: 128329
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-0/+9
which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
OpenPOWER on IntegriCloud