Граф коммитов

972 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian b9d5c22529 More Sema Check and a test case for init_priority attr.
(radar 8076356).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 23:14:53 +00:00
Douglas Gregor d2c6490385 Merge the "regparm" attribute from a previous declaration of a
function to redeclarations of that function. Fixes PR7025.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 21:30:25 +00:00
Douglas Gregor e0cc047b19 When parsing cached C++ method declarations/definitions, save the
"previous token" location at the end of the class definition. This
eliminates a badly-placed error + Fix-It when the ';' following a
class definition is missing. Fixes <rdar://problem/8066414>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 23:45:56 +00:00
John McCall 52a02758fb Fix the build. Using declarations should not be considering when looking
for overridden virtual methods.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106096 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 09:33:39 +00:00
John McCall ad00b7705f Fix a point of semantics with using declaration hiding: method templates
introduced by using decls are hidden even if their template parameter lists
or return types differ from the "overriding" declaration.

Propagate using shadow declarations around more effectively when looking up
template-ids.  Reperform lookup for template-ids in member expressions so that
access control is properly set up.

Fix some number of latent bugs involving template-ids with totally invalid
base types.  You can only actually get these with a scope specifier, since
otherwise the template-id won't parse as a template-id.

Fixes PR7384.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 08:42:20 +00:00
Douglas Gregor 6e5122c8ce Update equality and relationship comparisons of pointers to reflect
C++ semantics, eliminating an extension diagnostic that doesn't match
C++ semantics (ordered comparison with NULL) and tightening some
extwarns to errors in C++ to match GCC and maintain conformance in
SFINAE contexts. Fixes <rdar://problem/7941392>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106050 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15 21:38:40 +00:00
Chris Lattner 37dd3ecbfc Remove a dead argument to ProcessUCNEscape.
Fix string concatenation to treat escapes in concatenated strings that
are wide because of other string chunks to process the escapes as wide
themselves.  Before we would warn about and miscompile the attached testcase.

This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106012 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15 18:06:43 +00:00
John McCall 81e317a444 Allow pseudo-destructors to be called on qualified pointers. Patch by
Troy Straszheim!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 17:36:40 +00:00
Jeffrey Yasskin 5edbdcc620 Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed.  We default to 'all'.  At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105815 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 05:57:47 +00:00
Douglas Gregor 5a57efd7bf Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead
of requiring exact type equality for the second conversion step,
require type *similarity*, which is type equality with cv-qualifiers
removed at all levels. This appears to match the behavior of EDG and
VC++ (albeit not GCC), and feels more intuitive. Big thanks to John
for the line of reasoning that supports this change: since
cv-qualifiers are orthogonal to the second conversion step, we should
ignore them in the type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 03:53:18 +00:00
Douglas Gregor e1aa9f3a5d When referring to a tag that was previously declared only as a friend,
build a new declaration for that tag type that will be visible for
future lookups of that tag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 21:27:36 +00:00
Douglas Gregor ccd471341d A built-in overload candidate is consider a non-template function when
determining whether one overload candidate is better than
another. Fixes PR7319.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 21:03:17 +00:00
Douglas Gregor d64fdd0c05 Warn about comparisons between arrays and improve self-comparison
warnings, from Troy Straszheim! Fixes PR6163.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 19:50:34 +00:00
Anders Carlsson 45f5b54d67 Correctly handle fields with virtual bases containing empty subobjects.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 19:09:24 +00:00
Douglas Gregor d7a95971bd Implement a warning when converting the literal 'false' to a
pointer. Original patch by Troy D. Straszheim; fixes PR7283.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105621 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 17:35:15 +00:00
Anders Carlsson 52647c63c3 When deciding whether reinterpret_cast casts away constness we need to look at array qualifiers. Fixes rdar://problem/8018292.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-04 22:47:55 +00:00
Anders Carlsson 83a45e7dab Turn on the new empty base subobject tracking code. It's a bit faster than the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-30 06:52:33 +00:00
Anders Carlsson 3cd09ccbb1 Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-29 19:44:50 +00:00
John McCall 811d0bec4d Disable exception-spec compatibility checking under -fno-exceptions.
Fixes PR7243.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104942 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 08:37:35 +00:00
Douglas Gregor 76ef658c70 When we complain about a member being inaccessible due to a constraint
along an access path, add another note pointing at the member we
actually found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 04:34:55 +00:00
Anders Carlsson bff9eb7303 Another empty class layout test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 16:15:06 +00:00
Anders Carlsson 1a8d1511cd Add more empty class layout tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 16:07:49 +00:00
Fariborz Jahanian 2c0a54031c Improve on flexible array diagnostics (PR7029).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 20:46:24 +00:00
Fariborz Jahanian 4142cebf70 Fixes misc. flexible array bugs in c++ (PR7029).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 20:19:07 +00:00
Douglas Gregor af7bea5fb4 Make sure to strip off top-level cv-qualifiers as part of a
derived-to-base conversion on a pointer. Fixes PR7224.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104607 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-25 15:31:05 +00:00
Douglas Gregor 204ce17e0c Don't complain about VLAs of non-POD types when the array type is
dependent. Fixes <rdar://problem/8021385>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-24 20:42:30 +00:00
Douglas Gregor 836adf6771 Make sure that we instantiate variably modified types, even if they
aren't dependent. Fixes <rdar://problem/8020206>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-24 17:22:01 +00:00
Douglas Gregor 94a615718d Downgrade deletion of a void* from an error (which is should be) to an
extension warning (which other compilers seem to use). Works around a
known bug in Xalan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-24 17:01:56 +00:00
Douglas Gregor ae65f4bd58 An identity conversion is better than any non-identity
conversion. Fixes PR7095.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 22:10:15 +00:00
Douglas Gregor 88623ade95 In C++, one cannot assign from an arithmetic type to an enumeration
type. Fixes PR7051.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 21:53:47 +00:00
Douglas Gregor a481ec4150 It turns out that people love using VLAs in templates, too. Weaken our
VLA restrictions so that one can use VLAs in templates (even
accidentally), but not as part of a non-type template parameter (which
would be very bad).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 19:57:01 +00:00
Douglas Gregor 9ba6af8bed Complain about sizeof(overloaded function) rather than crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104470 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 19:43:23 +00:00
Anders Carlsson bfcdc40cbc When recording empty subobjects we should always look at the primary virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 18:14:24 +00:00
Douglas Gregor db4da82e72 Put the VLA-is-an-extension warning into its own warning group (-Wvla)
so that it can be selectively enabled/disabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 16:51:27 +00:00
Douglas Gregor 715e9c8a39 Even though we don't unique VLA types, we still need to build a
canonical type where the element type is canonical. Fixes PR7206.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-23 16:10:32 +00:00
Douglas Gregor d9008318fe When determining whether we can use "this", make sure to look through
enum contexts (along with block contexts, which we already did). Fixes
PR7196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-22 16:25:05 +00:00
Douglas Gregor 0fddb97901 Implement support for variable length arrays in C++. VLAs are limited
in several important ways:

  - VLAs of non-POD types are not permitted.
  - VLAs cannot be used in conjunction with C++ templates.

These restrictions are intended to keep VLAs out of the parts of the
C++ type system where they cause the most trouble. Fixes PR5678 and
<rdar://problem/8013618>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-22 16:17:30 +00:00
John McCall aec0371e62 Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 20:45:30 +00:00
Douglas Gregor e0d5fe2a41 Use CanQualType to enforce the use of a canonical type argument to
CXXBasePaths::isAmbiguous(), rather than just asserting that we have a
canonical type. Fixes PR7176.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-21 20:29:55 +00:00
Douglas Gregor fe2d379dbf Fix a crasher in constructor-initializer reordering warnings (PR7179).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 23:49:34 +00:00
Douglas Gregor 4e58c25aa5 Remove accidental commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104207 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 02:26:51 +00:00
Douglas Gregor 68dd3ee3b5 Various small fixes for construction/destruction of Objective-C++
instance variables:
  - Use isRecordType() rather than isa<RecordType>(), so that we see
  through typedefs in ivar types.
  - Mark the destructor as referenced
  - Perform C++ access control on the destructor


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 02:24:22 +00:00
John McCall ea1471e0e9 Support implicitly closing on 'this' in a block. Fixed PR7165.
(the codegen works here, too, but that's annoying to test without execution)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 01:18:31 +00:00
Douglas Gregor b65a45835a When a conditional operator is an rvalue of class type, we need to
create a temporary copy of both the "true" and "false" results. Fixes
the Boost.Interprocess failures.

Daniel did all the hard work of tracking down the issue, I get to type
up the trivial fix for this horrible miscompile.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 23:40:50 +00:00
Douglas Gregor 26bcf67d01 Implement C++ builtin operator candidates for vector types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-19 03:21:00 +00:00
Douglas Gregor a115855830 Basic test for user-defined conversions involving vector types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104085 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 23:05:44 +00:00
Douglas Gregor fb4a543683 Implement C++ support for vector and extended vector types. This
involves extending implicit conversion sequences to model vector
conversions and vector splats, along with teaching the C++ conditional
operator-checking code about vector types.

Fixes <rdar://problem/7983501>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104081 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 22:42:18 +00:00
John McCall 0fb97083cc If a switch condition is constant, don't warn about missing enum cases.
If a switch condition is constant, warn if there's no case for it.

Constant switch conditions do come up in reasonable template code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104010 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 03:19:21 +00:00
Chandler Carruth 00e9cbb13d Add a hack to silence warnings about failing to return from functions after
a temporary with a noreturn destructor has been created. Fixes PR6884 for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-17 23:51:52 +00:00
Douglas Gregor 293279ae43 Test that mutability of class members that involve class definitions actually works
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103959 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-17 19:45:25 +00:00