Commit Graph

10584 Commits

Author SHA1 Message Date
Aaron Ballman 5010a76fe2 The __w64 attribute handler was more generically named, but only applied to __w64 specifically. Renamed and removed some unused code. No functional change intended.
llvm-svn: 196116
2013-12-02 16:17:55 +00:00
Aaron Ballman 7a47bb0397 The FieldDecl is already covered by the ValueDecl case, so it is being removed.
llvm-svn: 196110
2013-12-02 15:31:50 +00:00
Aaron Ballman 9beb517307 Switching the ibaction attribute handler to the generalized handler. No functional change intended.
llvm-svn: 196107
2013-12-02 15:13:14 +00:00
Aaron Ballman e61b8b816a Replacing custom subject application logic with table-generated logic. Affects: guarded_var, pt_guarded_var, guarded_by, pt_guarded_by, acquired_after and acquired_before. No functional change intended.
llvm-svn: 196105
2013-12-02 15:02:49 +00:00
Alp Toker fff0674ae0 Fix inconsistent diag name
llvm-svn: 196061
2013-12-02 03:50:21 +00:00
Rafael Espindola 6edca7d9bd Handle CC and NoReturn when instantiating members of class templates.
Before we were considering them only when instantiating templates.

This fixes pr18033.

llvm-svn: 196050
2013-12-01 16:54:29 +00:00
Aaron Ballman 5b0481a398 Refactored the tls_model attribute to use a custom subset subject. No functional change intended.
llvm-svn: 195964
2013-11-29 16:20:30 +00:00
Aaron Ballman f7cd09a047 Using a custom subject to reenable the Subjects line for the ns_bridged attribute. No functional change intended.
llvm-svn: 195963
2013-11-29 16:13:12 +00:00
Aaron Ballman 80469038c0 Enables support for custom subject lists for attributes. As a testbed, uses the custom subject for the ibaction attribute.
llvm-svn: 195960
2013-11-29 14:57:58 +00:00
David Majnemer fd6c685f2e Sema: Instantiation of variable definitions weren't local enough
We wouldn't properly save and restore the pending local instantiations
we had built up prior to instantiation of a variable definition.  This
would lead to us instantiating too much causing crashes and other
general badness.

This fixes PR14374.

llvm-svn: 195887
2013-11-27 22:57:44 +00:00
Aaron Ballman 57ede3bd80 Converts the lockable attributes to use the simple attribute handler because the semantic checking was already automated.
llvm-svn: 195866
2013-11-27 19:35:27 +00:00
Aaron Ballman 17046b8506 Automated checking for C++ when determining what argument to send to the diagnostic for attribute subjects. In turn, this allows the Subjects to be enabled for some more attributes and improves diagnostics. Updated a test case based on the improved diagnostic.
llvm-svn: 195864
2013-11-27 19:16:55 +00:00
Aaron Ballman 3a8e2d9136 Adding the Subjects entry back for the noreturn attributes. This caused some test cases to be updated because the original diagnostic was about applying to methods as well as functions, but the semantic checking disallowed methods.
llvm-svn: 195862
2013-11-27 18:53:58 +00:00
Aaron Ballman 6a42b5a0c5 Enabling the subject list for the warn_unused attribute, and adding a test case. Previously, would issue a "warning ignored" diagnostic instead of the more specific "only applies to."
llvm-svn: 195851
2013-11-27 16:59:17 +00:00
Aaron Ballman 4a611153e1 Adding in the subject for the init_priority attribute.
llvm-svn: 195850
2013-11-27 16:34:09 +00:00
Aaron Ballman 6f9165a478 Refactored semantic handlers that would unilaterally apply the attribute to a Decl so they all go through a common interface. No functional change intended.
llvm-svn: 195848
2013-11-27 15:24:06 +00:00
Alexander Kornienko b4586f4217 Trivial fix: remove unused variable
llvm-svn: 195846
2013-11-27 15:02:03 +00:00
Aaron Ballman 74eeeae3d3 Laying the basic groundwork for table generating the diagnostics for attribute subjects. This makes some modifications to the way subjects are listed in Attr.td, and updates the attr emitter to handle the new constructs.
I have disabled some attribute subject lines on purpose in Attr.td;
this part is a WIP with the goal being to restore those subjects
incrementally. By commenting them out, it leaves the original behavior
the same as before for those attributes and so those are not
functionality changes.

llvm-svn: 195841
2013-11-27 13:27:02 +00:00
Argyrios Kyrtzidis 91486222d5 [Sema] Don't look for the instantiation of a local extern decl in a different
dependent context that the one we are instantiating, otherwise there will be an assertion.

rdar://15464547

llvm-svn: 195828
2013-11-27 08:34:14 +00:00
David Majnemer 192d1798b2 Sema: Instantiate local class and their members appropriately
We would fail to instantiate them when the surrounding function was
instantiated. Instantiate the class and add it's members to the list of
pending instantiations, they should be resolved when we are finished
with the function's body.

This fixes PR9685.

llvm-svn: 195827
2013-11-27 08:20:38 +00:00
Alp Toker 965f882588 Remove a whole lot of unused variables
There are about 30 removed in this patch, generated by a new FixIt I haven't
got round to submitting yet.

llvm-svn: 195814
2013-11-27 05:22:15 +00:00
Richard Smith 41c35d6d2f Unify lookup from within not-yet-defined defaulted special members: use common
code for handling triviality, deletedness and constexpr. Fix a few bugs in
these, particularly related to mutable members, and remove some dead code.

llvm-svn: 195809
2013-11-27 03:39:20 +00:00
Alp Toker c7c1ebe660 Implement -Wold-style-cast
Based on a patch by Ondřej Hošek!

llvm-svn: 195808
2013-11-27 03:18:17 +00:00
Richard Smith 852e9ce3dd Remove 'DistinctSpellings' support from Attr.td and change its only user to
look at the attribute spelling instead. The 'ownership_*' attributes should
probably be split into separate *Attr classes, but that's more than I wanted to
do here.

llvm-svn: 195805
2013-11-27 01:46:48 +00:00
Aaron Ballman b0dc07419b Replacing a custom diagnostic with a more standard one. No functional change intended.
llvm-svn: 195770
2013-11-26 16:14:15 +00:00
Richard Smith 8ac1c92df9 PR18044: Reject declarations of enumtype::X early to avoid an assertion in
downstream code.

llvm-svn: 195687
2013-11-25 21:30:29 +00:00
Aaron Ballman 90f8c6fb31 Making type_tag_for_datatype consistent with its declared subject from Attr.td. Also updated the related testcase.
Reviewed by Dmitri Gribenko.

llvm-svn: 195675
2013-11-25 18:50:49 +00:00
Richard Smith c91d12ce80 Take cv-qualifiers on fields of class type into account when determining
whether a defaulted special member function should be deleted.

llvm-svn: 195620
2013-11-25 07:07:05 +00:00
NAKAMURA Takumi 01d27f9705 SemaDeclAttr.cpp: Try to fix a warning [-Wunnamed-type-template-args]
llvm-svn: 195589
2013-11-25 00:52:29 +00:00
Aaron Ballman 3db89662c3 Switching the common attribute over to using the generic diagnostic, and removing the now-unused diagnostic. Updates a test case.
llvm-svn: 195581
2013-11-24 21:48:06 +00:00
Aaron Ballman df8fe4c91c __declspec(uuid) is only supported for C++ code according to MSDN (as well as behaviorally in MSVC). This adds a generic diagnostic that we use for uuid, and can use for some other attributes as well, and adds a testcase.
llvm-svn: 195580
2013-11-24 21:35:16 +00:00
Aaron Ballman 60e705e648 __declspec(uuid) is only allowed on a class according to MSDN; this makes the semantic checking consistent with what the attribute specifies in Attr.td. Also adds a test case.
llvm-svn: 195579
2013-11-24 20:58:02 +00:00
Aaron Ballman f361453519 Making some attribute diagnostics more consistent. Removes a newly-unused diagnostic.
Reviewed by Fariborz Jahanian

llvm-svn: 195578
2013-11-24 20:36:50 +00:00
Ted Kremenek 7559b47fa2 Remove optional parameter bit from attribute ObjCSuppressProtocol.
This refines some diagnostics and reduces some boilerplate checking logic.

llvm-svn: 195560
2013-11-23 22:29:11 +00:00
Ted Kremenek 28eace65c0 Add back experimental attribute objc_suppress_protocol_methods (slightly renamed).
This is still an experimental attribute, but I wanted it in tree
for review.  It may still get yanked.

This attribute can only be applied to a class @interface, not
a class extension or category.  It does not change the type
system rules for Objective-C, but rather the implementation checking
for Objective-C classes that explicitly conform to a protocol.
During protocol conformance checking, clang recursively searches
up the class hierarchy for the set of methods that compose
a protocol.  This attribute will cause the compiler to not consider
the methods contributed by a super class, its categories, and those
from its ancestor classes.  Thus this attribute is used to force
subclasses to redeclare (and hopefully re-implement) methods if
they decide to explicitly conform to a protocol where some of those
methods may be provided by a super class.

This attribute intentionally leaves out properties, which are associated
with state.  This attribute only considers methods (at least right now)
that are non-property accessors.  These represent methods that "do something"
as dictated by the protocol.  This may be further refined, and this
should be considered a WIP until documentation gets written or this
gets removed.

llvm-svn: 195533
2013-11-23 01:01:34 +00:00
Ted Kremenek 0078150c43 Change ObjCIntefaceDecl::lookupMethod() to have optional 'followsSuper' argument.
This enables a micro-optimization in protocol conformance checking
to not examine the class hierarchy twice per method.

As part of this change, remove the default arguments from lookupInstanceMethod()
and lookupClassMethod().  It was becoming very redundant.  For clients
needing the default arguments, have them use the full API instead of
these convenience methods.

llvm-svn: 195532
2013-11-23 01:01:29 +00:00
Fariborz Jahanian 36129a953d ObjectiveC. Remove warning diagnostic which checks
attribute on method declaration and implementation
match. This makes no sense. Most annotations are
meant for declarations only and one is for implementation.
This has been constant source of regresions and hackery to
get around special cases. I am removing this check.
Such checks must be done on a case by case basis and
when it makes sense. For example, it makes sense
for availability/deprecated and I will file a radar
for that. // rdar://15531984

llvm-svn: 195524
2013-11-23 00:14:32 +00:00
Aaron Ballman cc14f3a536 Whitespace. No functional change intended.
llvm-svn: 195503
2013-11-22 21:49:04 +00:00
Richard Smith f798172419 Add class-specific operator new to Decl hierarchy. This guarantees that Decls
can't accidentally be allocated the wrong way (missing prefix data for decls
from AST files, for instance) and simplifies the CreateDeserialized functions a
little. An extra DeclContext* parameter to the not-from-AST-file operator new
allows us to ensure that we don't accidentally call the wrong one when
deserializing (when we don't have a DeclContext), allows some extra checks, and
prepares for some planned modules-related changes to Decl allocation.

No functionality change intended.

llvm-svn: 195426
2013-11-22 09:01:48 +00:00
Fariborz Jahanian 2651ac5445 ObjectiveC migrator. Improve on definition, use
and testing of objc_bridgmutable attribute per
Aaron Ballman's comments.
// rdar://15498044

llvm-svn: 195396
2013-11-22 00:02:22 +00:00
Richard Smith 0449aaf39c PR18013: Don't assert diagnosing a bad std::initializer_list construction.
llvm-svn: 195384
2013-11-21 23:30:57 +00:00
Fariborz Jahanian 87c7791bb7 ObjectiveC. Implement attribute 'objc_bridge_mutable'
whose semantic is currently identical to objc_bridge,
but their differences may manifest down the road with
further enhancements. // rdar://15498044

llvm-svn: 195376
2013-11-21 20:50:32 +00:00
Ted Kremenek a14c3119ac Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class."
After implementing this patch, a few concerns about the language
feature itself emerged in my head that I had previously not considered.
I want to resolve those design concerns first before having
a half-designed language feature in the tree.

llvm-svn: 195328
2013-11-21 07:57:53 +00:00
Ted Kremenek a4bd9a0c0e Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class.
The idea is to allow a class to stipulate that its methods (and those
of its parents) cannot be used for protocol conformance in a subclass.
A subclass is then explicitly required to re-implement those methods
of they are present in the class marked with this attribute.

Currently the attribute can only be applied to an @interface, and
not a category or class extension.  This is by design.  Unlike
protocol conformance, where a category can add explicit conformance
of a protocol to class, this anti-conformance really needs to be
observed uniformly by all clients of the class.  That's because
the absence of the attribute implies more permissive checking of
protocol conformance.

This unfortunately required changing method lookup in ObjCInterfaceDecl
to take an optional protocol parameter.  This should not slow down
method lookup in most cases, and is just used for protocol conformance.

llvm-svn: 195323
2013-11-21 07:20:42 +00:00
Ted Kremenek 2d3379e394 Refactor some of handleObjCBridgeAttr to make it more concise and the diagnostic reusable.
llvm-svn: 195322
2013-11-21 07:20:34 +00:00
Hans Wennborg 84fe12d1e9 Provide better diagnostic wording for initializers on static
data member definitions when the variable has an initializer
in its declaration.

For the following code:

  struct S {
    static const int x = 42;
  };
  const int S::x = 42;

This patch changes the diagnostic from:

  a.cc:4:14: error: redefinition of 'x'
  const int S::x = 42;
               ^
  a.cc:2:20: note: previous definition is here
    static const int x = 42;
                     ^
to:

  a.cc:4:18: error: static data member 'x' already has an initializer
  const int S::x = 42;
                   ^
  a.cc:2:24: note: previous initialization is here
    static const int x = 42;
                         ^

Differential Revision: http://llvm-reviews.chandlerc.com/D2235

llvm-svn: 195306
2013-11-21 03:17:44 +00:00
Richard Smith e934d7c9f5 PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more
targeted, approach than that in r194540.

llvm-svn: 195303
2013-11-21 01:53:02 +00:00
Aaron Ballman f22ef5ab1a Refactored integer argument checking code into a helper method. Removes a considerable amount of duplicated code.
llvm-svn: 195302
2013-11-21 01:50:40 +00:00
Fariborz Jahanian 8c5b4be417 ObjectiveC. Allow toll free bridge cast warnings outside
ARC and in objectiveC/ObjectiveC++ MRR mode as well.
// rdar://15454846

llvm-svn: 195288
2013-11-21 00:39:36 +00:00
Aaron Ballman 18a7838e3e Implemented DefaultIntArgument in the table generator and start using it in semantic analysis. Removes some magic numbers.
llvm-svn: 195287
2013-11-21 00:28:23 +00:00
Fariborz Jahanian 1f92b7f7c4 ObjectiveC ARC. warn in presense of __bridge casting to
or from a toll free bridge cast. // rdar://15454846

llvm-svn: 195278
2013-11-20 22:55:41 +00:00
Aaron Ballman b80f94b41c There is no such thing as __declspec(ms_struct), this is a GNU attribute. Switched the attribute to have the proper spelling, gave it a subject, updated the warning to be more accurate, and updated the test case as appropriate.
llvm-svn: 195277
2013-11-20 22:22:04 +00:00
Aaron Ballman 07e2764ce7 Removed a duplicate diagnostic related to attribute subjects for thread safety annotations, and replaced it with the more general attribute diagnostic. Updated the test case in the one instance where wording changed. No functional change intended.
llvm-svn: 195275
2013-11-20 21:41:42 +00:00
Ted Kremenek cb42dbe7ad Refine 'deprecated' checking for Objective-C classes/methods.
- If a deprecated class refers to another deprecated class, do not warn.
- @implementations of a deprecated class can refer to other deprecated things.

Fixes <rdar://problem/15407366> and <rdar://problem/15466783>.

llvm-svn: 195259
2013-11-20 17:24:03 +00:00
Enea Zaffanella d8430928f1 When wrapping lazily generated builtins in an extern "C" context,
flag the LinkageSpecDecl as being implicitly generated too.

llvm-svn: 195255
2013-11-20 15:41:05 +00:00
Aaron Ballman dbb634f882 Removing a custom error diagnostic and replacing it with a stock one. Added a test case to ensure the diagnostic was firing properly.
llvm-svn: 195188
2013-11-20 01:35:23 +00:00
Fariborz Jahanian 92ab2985da ObjectiveC ARC. validate toll free bridge casting
to or from 'id' and qualified-id types.
// rdar://15454846

llvm-svn: 195178
2013-11-20 00:32:12 +00:00
Richard Smith 404dfb46a9 PR9547: If we're parsing a simple-declaration that contains a tag definition,
and we see an ill-formed declarator that would probably be well-formed if the
tag definition were just missing a semicolon, use that as the diagnostic
instead of producing some other mysterious error.

llvm-svn: 195163
2013-11-19 22:47:36 +00:00
Aaron Ballman ecf81c09f5 Switching some string literals to be generated by the AttributeList object itself.
llvm-svn: 195160
2013-11-19 22:18:24 +00:00
Rafael Espindola 92045bc37c Further fixes when thiscall is the default for methods.
The previous patches tried to deduce the correct function type. I now realize
this is not possible in general. Consider

class foo {
    template <typename T> static void bar(T v);
};
extern template void foo::bar(const void *);

We will only know that bar is static after a lookup, so we have to handle this
in the template instantiation code.

This patch reverts my previous two changes (but not the tests) and instead
handles the issue in DeduceTemplateArguments.

llvm-svn: 195154
2013-11-19 21:07:04 +00:00
Fariborz Jahanian 3b65982b9f ObjectiveC ARC. Removes a bogus warning when a weak
property is redeclared as 'weak' in class extension.
// rdar://15465916

llvm-svn: 195146
2013-11-19 19:26:30 +00:00
Fariborz Jahanian f720f86774 bjectiveC. Use a uniform diagnostic for
'objc_bridge' attribute. // rdar://15454846.

llvm-svn: 195135
2013-11-19 17:42:25 +00:00
Joerg Sonnenberger 05bd2da328 Revert r194540, it breaks various C++ programs.
llvm-svn: 195126
2013-11-19 13:38:38 +00:00
Richard Smith fe9d2c0609 Rename an extension warning to ext_...
llvm-svn: 195095
2013-11-19 03:41:32 +00:00
Fariborz Jahanian dae5ec5915 ObjectiveC objc_bridge. Minor refactoring.
// rdar://15454846

llvm-svn: 195070
2013-11-19 01:38:23 +00:00
Fariborz Jahanian 509f31efd0 ObjectiveC 'objc_bridging'. Assorment of improvements
per Doug/Jordan comments. // rdar://15454846.

llvm-svn: 195066
2013-11-19 01:23:07 +00:00
Fariborz Jahanian db3d8554be ObjectiveC ARC. Adopt objc_bridge attribute
on struct/union/class instead of typedef of
such types. // rdar://15454846

llvm-svn: 195061
2013-11-19 00:09:48 +00:00
Rafael Espindola 4903c87386 The attached patch is a follow up from my previous one. The existing
logic was not handling typedefs as free functions. This was not
causing problems with the existing tests, but does with the microsoft
abi where they have to get a different calling convention.

I will try to refactor this into a method on Declarator in a second.

llvm-svn: 195050
2013-11-18 22:40:04 +00:00
Rafael Espindola f02d8b1dff Use the default method CC in GetFullTypeForDeclarator.
Before this patch explicit template instatiations of member function templates
were failing with the microsoft abi and 32 bits. This was happening because
the expected and computed function types had different calling conventions.

This patch fixes it by considering the default calling convention in
GetFullTypeForDeclarator.

This fixes pr17973.

llvm-svn: 195032
2013-11-18 20:05:33 +00:00
Fariborz Jahanian 2c31212827 ObjectiveC ARC. More validation of toll-free bridging of
CF objects with objc_bridge'ing annotaiton.
// rdar://15454846

llvm-svn: 194938
2013-11-16 23:22:37 +00:00
Fariborz Jahanian 8a0210e535 ObjectiveC ARC. Validate toll free bridge casting
of ObjectiveC objects to CF types when CF type
has the objc_bridge attribute.

llvm-svn: 194930
2013-11-16 19:16:32 +00:00
Richard Smith fa27bc4c7b If a replaceable global operator new/delete is marked inline, don't warn if
it's also __attribute__((used)), since that undoes the problematic part of
'inline'.

llvm-svn: 194916
2013-11-16 01:57:09 +00:00
Fariborz Jahanian f07183ce94 ObjetiveC ARC. Start diagnosing invalid toll free bridging.
// rdar://15454846.

llvm-svn: 194915
2013-11-16 01:45:25 +00:00
Richard Smith 13dfdc88a9 Downgrade the Error on an 'inline' operator new or delete to an ExtWarn. Some
projects are relying on such (questionable) practices, so we should give them
a way to opt out of this diagnostic.

llvm-svn: 194905
2013-11-16 00:47:38 +00:00
Fariborz Jahanian b8233193a4 ObjectiveC ARC. Only briding of pointer to struct CF object is allowed.
Improve on wording on illegal objc_bridge argumment.
// rdar://15454846

llvm-svn: 194881
2013-11-15 23:14:45 +00:00
Fariborz Jahanian a649c82d69 ObjectiveC ARC. Lookup type associated with objc_bridage at
the point of CF object type-cast and issue diagnostic
if it is not a valid ObjectiveC class. // rdar//15454846.
This is wip.

llvm-svn: 194861
2013-11-15 22:18:17 +00:00
Fariborz Jahanian 617e49ad59 ObjectiveC. Fixes a bogus warning of unused backing
ivar when property belongs to a super class and
currnt class happens to have a method with same name as
property. // rdar//15473432

llvm-svn: 194830
2013-11-15 17:48:00 +00:00
Richard Smith ce587f5eb9 When we hit a #include directive that maps to a module import, emit a token
representing the module import rather than making the module immediately
visible. This serves two goals:
 * It avoids making declarations in the module visible prematurely, if we
   walk past the #include during a tentative parse, for instance, and
 * It gives a diagnostic (although, admittedly, not a very nice one) if
   a header with a corresponding module is included anywhere other than
   at the top level.

llvm-svn: 194782
2013-11-15 04:24:58 +00:00
Richard Smith c156470be5 PR17533 and duplicates: don't compute the return type of an overloaded operator
until after we've referenced the operator; otherwise, we might pick up a
not-yet-deduced type.

llvm-svn: 194775
2013-11-15 02:58:23 +00:00
Richard Smith 83d4834597 Don't reject dependent range-based for loops in constexpr functions. The loop
variable isn't really uninitialized, it's just not initialized yet.

llvm-svn: 194767
2013-11-15 02:29:26 +00:00
Joey Gouly 561bba2e9f [OpenCL] Make sure we put string literals in the constant address space.
llvm-svn: 194717
2013-11-14 18:26:10 +00:00
Ted Kremenek 435b4c786a Revert r194663 and r194647.
Per feedback from Jordan Rose I realized this wasn't the right way to go.

llvm-svn: 194664
2013-11-14 04:44:56 +00:00
Ted Kremenek 428b61dc14 Refine -Wunused-variable to only suppress warning for __bridge_transfer, not all bridge casts.
Also refine test case to capture the intention of this suppression.  Essentially
some developers use __bridge_transfer as if it were a safe CFRelease.

llvm-svn: 194663
2013-11-14 04:27:00 +00:00
Kevin Qin caac85e612 [AArch64 neon] support poly64 and relevant intrinsic functions.
llvm-svn: 194660
2013-11-14 03:29:16 +00:00
Serge Pavlov 3cb8022849 Added warning on structures/unions that are empty or contain only
bit fields of zero size. Warnings are generated in C++ mode and if
only such type is defined inside extern "C" block.
The patch fixed PR5065.

Differential Revision: http://llvm-reviews.chandlerc.com/D2151

llvm-svn: 194653
2013-11-14 02:13:03 +00:00
Ted Kremenek f6171b3cdf Suppress -Wunused-variable when initializer uses bridge casts for memory management.
Fixes <rdar://problem/15432770>.

llvm-svn: 194647
2013-11-14 01:42:17 +00:00
Fariborz Jahanian ae02d1552f ObjectiveC ARC. objc_bridge attribute should be applied to
toll-free bridging cf types only. // rdar//15454846 wip.

llvm-svn: 194640
2013-11-14 00:43:05 +00:00
Fariborz Jahanian 0a0a39708c ObjectiveC ARC. Introduce a new attribute, 'objc_bridge'
that teaches the compiler about a subset of toll-free 
bridging semantics. This is wip. // rdar://15454846

llvm-svn: 194633
2013-11-13 23:59:17 +00:00
Serge Pavlov 750db65bac Warn on duplicate function specifier
This patch fixes PR8264. Duplicate qualifiers already are diagnozed,
now the same diagnostics is issued for duplicate function specifiers.

Differential Revision: http://llvm-reviews.chandlerc.com/D2025

llvm-svn: 194559
2013-11-13 06:57:53 +00:00
Richard Smith 7309f60b9e PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. Patch by Ivan A. Kosarev!

llvm-svn: 194540
2013-11-13 01:24:28 +00:00
Weiming Zhao 87bb4920e9 add intrinsics: __builtin_arm_{dmb,dsb} for ARM
llvm-svn: 194513
2013-11-12 21:42:50 +00:00
Faisal Vali 218e94b6b6 COSMETIC: Fix 80 column overflow in some comments introduced in r194188
no functionality change.

llvm-svn: 194449
2013-11-12 03:56:08 +00:00
Faisal Vali 8bc2bc71f6 A quick fix to PR17877 that was introduced by r194188 (generic-lambda-capturing) that broke libc++.
See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033369.html for discussion on cfe-dev.

This fix explicitly checks whether we are within the declcontext of a lambda's call operator - which is what I had intended to be true (and assumed would be true if getCurLambda returns a valid pointer) before checking whether a lambda can capture the potential-captures of the innermost lambda.

A deeper fix (that addresses why getCurLambda() returns a valid pointer when perhaps it shouldn't?) - as proposed by Richard Smith in http://llvm.org/bugs/show_bug.cgi?id=17877 - has been suggested as a FIXME.

Patch was LGTM'd by Richard (just barely :)

http://llvm-reviews.chandlerc.com/D2144

llvm-svn: 194448
2013-11-12 03:48:27 +00:00
Richard Smith 16e1b07597 Rather than duplicating extension diagnostics to allow them to cause a
substitution failure, allow a flag to be set on the Diagnostic object,
to mark it as 'causes substitution failure'.

Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior
rather than a bunch of flags.

llvm-svn: 194444
2013-11-12 02:41:45 +00:00
Faisal Vali 97d8c33fa7 COSMETIC: Right justify an asterix in the previous refactoring.
Hopefully Richard won't notice this terrible egregiocity - clearly the work of a malevolent poltergeist - fixed now ;)

No functionality change.

llvm-svn: 194439
2013-11-12 01:46:33 +00:00
Faisal Vali 524ca28b2b REFACTOR: Have PushLambdaScope return the LambdaScopeInfo that it creates.
No Functionality change.

This refactoring avoids having to call getCurLambda right after PushLambdaScope, to obtain the LambdaScopeInfo that was created during the call to PushLambdaScope. 

llvm-svn: 194438
2013-11-12 01:40:44 +00:00
Richard Smith cd556eb265 Issue a diagnostic if we see a templated friend declaration that we do not
support.

llvm-svn: 194273
2013-11-08 18:59:56 +00:00
Douglas Gregor 9f2ed47133 s/DebugPrint/dump/g
llvm-svn: 194242
2013-11-08 02:16:10 +00:00
Douglas Gregor c9f019ab0f Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained reference.
Under ARC++, a reference to a const Objective-C pointer is implicitly
treated as __unsafe_unretained, and can be initialized with (e.g.) a
__strong lvalue. Make sure this behavior does not break template
argument deduction and (related) that partial ordering still prefers a
'T* const&' template over a 'T const&' template when this case kicks
in. Fixes <rdar://problem/14467941>.

llvm-svn: 194239
2013-11-08 02:04:24 +00:00
Douglas Gregor 2ee1d99d00 Fix a bogus assert I introduced in r194224
llvm-svn: 194237
2013-11-08 01:20:25 +00:00