Commit Graph

33 Commits

Author SHA1 Message Date
Erik Pilkington e300395c37 [Sema] Don't allow -Wunguarded-availability to be silenced with redecls
Differential revision: https://reviews.llvm.org/D33816

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 17:08:56 +00:00
Erich Keane 4a1e0b13e7 Correct class-template deprecation behavior-REDUX
Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Previous DiffRev: https://reviews.llvm.org/D27486, was reverted.
This patch fixes the issues brought up here by the reverter: https://reviews.llvm.org/rL298410

Differential Revision: https://reviews.llvm.org/D31245


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23 18:51:54 +00:00
Martin Bohme d29393efed Revert "Correct class-template deprecation behavior"
This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 13:34:37 +00:00
Martin Bohme f676817f11 Revert "iFix Test deprecation behavior in C89 mode as a result of r298410"
This reverts commit r298433. (Required to revert r298410, see comments
there.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 13:33:03 +00:00
Erich Keane 105ac0a067 iFix Test deprecation behavior in C89 mode as a result of r298410
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 20:14:46 +00:00
Erich Keane c1312361da Correct class-template deprecation behavior
Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Differential Revision: https://reviews.llvm.org/D27486


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 17:49:17 +00:00
Sunil Srivastava a2bd0cef65 Set the default C standard to C99 when targeting the PS4.
Patch by Douglas Yung!

Differential Revision: http://reviews.llvm.org/D19003


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:53:03 +00:00
Richard Smith b241411e50 Switch C compilations to C11 by default.
This is long-since overdue, and matches GCC 5.0. This should also be
backwards-compatible, because we already supported all of C11 as an extension
in C99 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220244 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-20 23:26:58 +00:00
Ted Kremenek 00374d1830 Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.

This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings.  By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent.  It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.

This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated".  It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
 (e.g., "function" instead of "destructor").  By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away.  This diagnostic can likely be further wordsmithed
to be shorter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197627 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-18 23:30:06 +00:00
Eli Friedman 9ec4099a09 Merge attributes on typedef decls.
Not completely sure this is right, but it's clearly better than what
we did before this commit (effectively dropping the attribute).

<rdar://problem/14413117>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186373 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 02:07:49 +00:00
Eli Friedman f66a0dda54 Handle deprecation diagnostics correctly for C struct fields and Objective-C properties/ivars. <rdar://problem/6642337>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161534 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08 23:04:35 +00:00
Eli Friedman c3b2308f66 Unify the codepaths for emitting deprecation warnings. The test changes are just to account for us emitting notes more consistently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161528 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08 21:52:41 +00:00
Fariborz Jahanian 350e956532 -Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://10893232


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157537 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27 16:59:48 +00:00
Eli Friedman fc038e9ef8 Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:36:09 +00:00
Fariborz Jahanian 39b4fc888d pinpoint name/location of deprecated/unavailable enumerator
whose enum has been made deprecated/unavailable in the warning.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-28 19:45:58 +00:00
Fariborz Jahanian 97db7265ac c - Enumerators may inherit the deprecated/unavailable
attributes from the enumeration type.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-29 18:40:01 +00:00
Douglas Gregor 54001c1e6a Check for deprecated/unavailable/etc attributes on fields that are
initialized via initializer lists. Fixes <rdar://problem/9694686>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-29 21:51:31 +00:00
John McCall 4820908be9 Document Clang's support for attributes on individual enumerators and
tweak the documentation for deprecation-with-message.  Provide __has_feature
tests for both.  rdar://problem/8605692



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118435 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 19:48:17 +00:00
John McCall 5b629aa86c Parse attributes on enumerators and instantiate attributes on enum decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 23:36:17 +00:00
Chandler Carruth 7d5c45ed9d Add support for differentiating between attributes ignored when handled and
unknown attributes that we discard. Add a diagnostic group for unknown
attribute warnings to allow turning these off when we don't care. Also
consolidates the tests for this case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-08 09:42:26 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
John McCall 54abf7d4fa Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context.  In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C.  If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 02:18:39 +00:00
Chris Lattner 523382640e Implement rdar://6756623 - use of deprecated type in deprecated typedef should not warn
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 22:31:57 +00:00
Chris Lattner d451f836be When parsing a top level struct declaration, make sure to
process decl attributes instead of dropping them on the floor.
This allows us to diagnose cases like the testcase.  Also don't
diagnose deprecated stuff in ActOnTag: not all uses of tags
may be 'uses', and SemaType does this now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 22:21:57 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Chris Lattner 22bd905673 diagnose uses of deprecated typenames and tags.
We now pass all the deprecation tests in the objc.dg suite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 22:07:16 +00:00
Chris Lattner 553905db4c add support for deprecated objc ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 17:19:12 +00:00
Chris Lattner cfdff38e8e Add support for deprecated members of RecordDecls (e.g. struct fields).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 17:07:21 +00:00
Chris Lattner 61a0f17301 allow implementations of deprecated functions to use deprecated symbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64572 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 01:38:09 +00:00
Chris Lattner 4238254b98 new tests, it would be nice to not warn on the second one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 08:27:44 +00:00
Anders Carlsson b235caa53b Start warning about unknown attributes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 08:22:04 +00:00
Chris Lattner f37da0ea0e rename some attr tests for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 06:32:02 +00:00