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

59 Коммитов

Автор SHA1 Сообщение Дата
Sebastian Redl 0b5e7fbb94 Add deleted functions and rvalue references to C++ status.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68903 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-12 17:41:24 +00:00
Anders Carlsson 5705e53689 We fully support namespace aliases now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:17:14 +00:00
Anders Carlsson 1edac4d61d class.abstract is complete. Anything that doesn't work is a bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 01:24:06 +00:00
Douglas Gregor 33aa5199bb Link from the C++ status page to the open projects page
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 20:39:57 +00:00
Anders Carlsson c31a0cee75 We support static_assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 17:28:26 +00:00
Douglas Gregor 35adb754b6 Note some advances in our C++ support
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 00:09:31 +00:00
Gabor Greif 70f2a0485d fix (hopefully) some validation errors
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 15:22:45 +00:00
Cedric Venet 3d658640ab Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 20:20:19 +00:00
Sebastian Redl 4a4251b9e7 Make const-initialized const integral variables I-C-Es in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64015 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 13:06:23 +00:00
Sebastian Redl 3268825a8e Fill in C++ status table for section 7 (declarations).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 12:42:13 +00:00
Sebastian Redl 224605064a Implement dereferencing of pointers-to-member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 00:15:38 +00:00
Sebastian Redl 33b399a8fd Implement taking address of member functions, including overloaded ones.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 21:23:32 +00:00
Douglas Gregor 09413dca1b Argument Dependent Lookup is done (for now). Also, update the status
for a few other name-lookup sections.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 15:07:16 +00:00
Douglas Gregor 930d8b5ecc Implement and test aggregate initialization in C++. Major changes:
- Support initialization of reference members; complain if any
  reference members are left uninitialized.
  - Use C++ copy-initialization for initializing each element (falls
  back to constraint checking in C)
  - Make sure we diagnose when one tries to provide an initializer
  list for a non-aggregate.
  - Don't complain about empty initializers in C++ (they are permitted)
  - Unrelated but necessary: don't bother trying to convert the
  decl-specifier-seq to a type when we're dealing with a C++
  constructor, destructor, or conversion operator; it results in
  spurious warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 22:09:00 +00:00
Sebastian Redl 21593acb93 Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 18:33:18 +00:00
Douglas Gregor 6697312178 Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 17:15:10 +00:00
Sebastian Redl db64728e69 Add handling of member pointers to reinterpret_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 23:18:31 +00:00
Sebastian Redl f20269b428 Add support for member pointers to const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63055 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 22:19:12 +00:00
Sebastian Redl 51abf6b3bf Update C++ status table with new member pointer conversion capabilities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 00:11:25 +00:00
Douglas Gregor 09f41cf63f Introduce support for C++0x explicit conversion operators (N2437)
Small cleanup in the handling of user-defined conversions. 

Also, implement an optimization when constructing a call. We avoid
recomputing implicit conversion sequences and instead use those
conversion sequences that we computed as part of overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-14 15:45:31 +00:00
Douglas Gregor 88b4bf202a Add the proper restrictions on the left-hand argument of a built-in
assignment operator candidate (C++ [over.match.oper]p4).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 00:52:54 +00:00
Douglas Gregor 3f20a682ba Update C++ status and add a few more tests of overloading for member function calls
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 23:20:38 +00:00
Douglas Gregor 6b3945f4bc Finished semantic analysis of anonymous unions in C++.
Duplicate-member checking within classes is still a little messy, and
anonymous unions are still completely broken in C. We'll need to unify
the handling of fields in C and C++ to make this code applicable in
both languages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-07 19:46:03 +00:00
Douglas Gregor f780abc21c Parser support for C++ using directives, from Piotr Rak
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-30 03:27:21 +00:00
Sebastian Redl 39e98008eb Fill in C++ status table for statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 17:18:13 +00:00
Sebastian Redl e6d5a4a583 Implement checks for bool in increment and decrement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-20 09:35:34 +00:00
Douglas Gregor 69497c315f Added a test for default arguments added to out-of-line member
functions. They work except that name lookup within the default
arguments needs to be deferred until the class definition is complete
(see FIXME in the test).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61059 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 00:08:34 +00:00
Sebastian Redl 8b9ad38dab Fill in C++ status table for expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60763 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 14:40:01 +00:00
Sebastian Redl 377fa5d532 Fill in some parts of cxx_status.html
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 16:24:08 +00:00
Sebastian Redl 5eb1969ccc Parsing new and delete is now complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 17:22:40 +00:00
Sebastian Redl cee63fbf0e Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 14:43:59 +00:00
Douglas Gregor 01f0fcd3ea Update C++ status
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59735 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 16:46:32 +00:00
Douglas Gregor 106c6eb3f1 Implement the rest of C++ [over.call.object], which permits the object
being called to be converted to a reference-to-function,
pointer-to-function, or reference-to-pointer-to-function. This is done
through "surrogate" candidate functions that model the conversions
from the object to the function (reference/pointer) and the
conversions in the arguments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59674 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 22:57:39 +00:00
Douglas Gregor f9eb905197 Support for calling overloaded function call operators (operator())
with function call syntax, e.g.,

  Functor f;
  f(x, y);

This is the easy part of handling calls to objects of class type 
(C++ [over.call.object]). The hard part (coping with conversions from
f to function pointer or reference types) will come later. Nobody uses
that stuff anyway, right? :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 21:05:33 +00:00
Douglas Gregor 337c6b9f5d Support overloading of the subscript operator[], including support for
built-in operator candidates. Test overloading of '&' and ','.

In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59643 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 17:17:41 +00:00
Douglas Gregor 7425373618 Added operator overloading for unary operators, post-increment, and
post-decrement, including support for generating all of the built-in
operator candidates for these operators. 

C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.

In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 15:42:04 +00:00
Sebastian Redl 669d5d74b8 Implement parsing and semantic checking of the 'mutable' keyword.
Thanks to Doug for the review. Actual effects of mutable to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59331 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-14 23:42:31 +00:00
Sebastian Redl c42e118384 Implement C++ 'typeid' parsing and sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 11:37:55 +00:00
Douglas Gregor 904eed3f61 Basic support for taking the address of an overloaded function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59000 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 20:40:00 +00:00
Sebastian Redl 9324e58a23 Update C++ status: class support improved due to nested name parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58932 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 11:32:32 +00:00
Sebastian Redl ab963c6221 Update C++ status to reflect parser capabilities for chapter 9 (classes). Slightly extend the class parser test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 15:40:37 +00:00
Sebastian Redl ffb5b009f8 Update C++ status: dynamic_cast is sema-complete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 14:43:13 +00:00
Cedric Venet d60b92760f Use css style instead of hard coded color in cxx_status. No visible change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 22:24:44 +00:00
Douglas Gregor ed1eedd5c4 Update C++ status
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 20:16:04 +00:00
Douglas Gregor eaebc75ef6 Initial, rudimentary implementation of operator overloading for binary
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.

The other kinds of overloadable operators in C++ will follow this same
approach. 

Three major issues remain:
  1) We don't find member operators
  2) Since we don't have user-defined conversion operators, we can't
  call any of the built-in overloaded operators in C++ [over.built].
  3) Once we've done the semantic checks, we drop the overloaded
  operator on the floor; it doesn't get into the AST at all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 23:29:22 +00:00
Douglas Gregor 1cd1b1e987 Parsing, ASTs, and semantic analysis for the declaration of overloaded
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 22:13:31 +00:00
Douglas Gregor 42a552f820 Parsing, representation, and preliminary semantic analysis of destructors.
Implicit declaration of destructors (when necessary).

Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58767 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 20:51:48 +00:00
Douglas Gregor 7ad8390f79 Initial implementation of parsing, semantic analysis, and AST-building
for constructor initializations, e.g.,

  class A { };
  class B : public A { 
    int m;
  public:
    B() : A(), m(17) { };
  };





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 04:29:56 +00:00
Daniel Dunbar dac74157b1 Remove stray character.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58713 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 18:44:31 +00:00
Douglas Gregor 456f82da3f Fine-grained C++ status page
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 15:52:45 +00:00