Commit Graph

299 Commits

Author SHA1 Message Date
Douglas Gregor 5fb5397238 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.

llvm-svn: 62231
2009-01-14 15:45:31 +00:00
Ted Kremenek f9d3f0711a Updated checker build.
llvm-svn: 62137
2009-01-13 01:41:37 +00:00
Douglas Gregor c5e61070f6 Add the proper restrictions on the left-hand argument of a built-in
assignment operator candidate (C++ [over.match.oper]p4).

llvm-svn: 62128
2009-01-13 00:52:54 +00:00
Douglas Gregor ae5e28578c Update C++ status and add a few more tests of overloading for member function calls
llvm-svn: 62121
2009-01-12 23:20:38 +00:00
Douglas Gregor f4d332797b 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.

llvm-svn: 61878
2009-01-07 19:46:03 +00:00
Ted Kremenek 4cfd63b5a4 Update checker build.
llvm-svn: 61843
2009-01-07 01:10:24 +00:00
Douglas Gregor d7c4d984d0 Parser support for C++ using directives, from Piotr Rak
llvm-svn: 61486
2008-12-30 03:27:21 +00:00
Sebastian Redl 58097c79c2 Fill in C++ status table for statements.
llvm-svn: 61457
2008-12-28 17:18:13 +00:00
Sebastian Redl e10c2c32af Implement checks for bool in increment and decrement.
llvm-svn: 61275
2008-12-20 09:35:34 +00:00
Ted Kremenek ab66b87f7f Updated checker build.
llvm-svn: 61273
2008-12-20 02:16:48 +00:00
Ted Kremenek dde7df9de2 Updated checker build.
llvm-svn: 61233
2008-12-19 00:19:19 +00:00
Ted Kremenek a1fd586dca Updated checker build.
llvm-svn: 61173
2008-12-17 23:55:41 +00:00
Ted Kremenek be3864ae6f Updated checker build.
llvm-svn: 61151
2008-12-17 21:02:35 +00:00
Douglas Gregor dd12c786a0 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).

llvm-svn: 61059
2008-12-16 00:08:34 +00:00
Ted Kremenek d2f9cd1cbd Updated checker build.
llvm-svn: 61002
2008-12-14 01:25:59 +00:00
Ted Kremenek 0bc1320d95 Updated checker build.
llvm-svn: 60864
2008-12-11 00:20:13 +00:00
Ted Kremenek a30391c31f Updated checker build.
llvm-svn: 60819
2008-12-10 00:50:24 +00:00
Sebastian Redl e0c2affc5e Fill in C++ status table for expressions.
llvm-svn: 60763
2008-12-09 14:40:01 +00:00
Sebastian Redl 82639aff7b Fill in some parts of cxx_status.html
llvm-svn: 60699
2008-12-08 16:24:08 +00:00
Sebastian Redl 5c6ebcc198 Parsing new and delete is now complete.
llvm-svn: 60425
2008-12-02 17:22:40 +00:00
Sebastian Redl 351bb78a10 Handle new by passing the Declaration to the Action, not a processed type.
llvm-svn: 60413
2008-12-02 14:43:59 +00:00
Nuno Lopes 6cdcbd1f95 add note about running the test suite with valgrind
llvm-svn: 60029
2008-11-25 15:46:06 +00:00
Douglas Gregor 8e3e16ed2e Update C++ status
llvm-svn: 59735
2008-11-20 16:46:32 +00:00
Douglas Gregor ab7897ac44 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.

llvm-svn: 59674
2008-11-19 22:57:39 +00:00
Douglas Gregor 91cea0ad1e 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? :)

llvm-svn: 59663
2008-11-19 21:05:33 +00:00
Douglas Gregor 40412acc02 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.

llvm-svn: 59643
2008-11-19 17:17:41 +00:00
Douglas Gregor d08452f60a 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.

llvm-svn: 59638
2008-11-19 15:42:04 +00:00
Ted Kremenek 29704928b7 Updated checker build.
llvm-svn: 59591
2008-11-19 05:46:43 +00:00
Daniel Dunbar bf45c9a4e4 Add some quick notes on the clang tests and running the LLVM test
suite with clang.

llvm-svn: 59536
2008-11-18 17:56:21 +00:00
Ted Kremenek ee4fa9cfbb Updated checker build.
llvm-svn: 59503
2008-11-18 07:27:02 +00:00
Ted Kremenek f9f58f085d Updated checker build.
llvm-svn: 59457
2008-11-17 19:26:13 +00:00
Ted Kremenek 9f748e23e3 Updated checker build.
llvm-svn: 59353
2008-11-15 04:57:19 +00:00
Sebastian Redl ccdfabab35 Implement parsing and semantic checking of the 'mutable' keyword.
Thanks to Doug for the review. Actual effects of mutable to follow.

llvm-svn: 59331
2008-11-14 23:42:31 +00:00
Daniel Dunbar 62efa23518 Fix some validation errors.
llvm-svn: 59272
2008-11-13 23:01:34 +00:00
Daniel Dunbar ed40bc19c9 Start a "hacking" page with some simple notes on getting started
developing clang.

llvm-svn: 59270
2008-11-13 22:49:41 +00:00
Ted Kremenek 83844100fb Revert to older checker build.
llvm-svn: 59209
2008-11-13 01:30:19 +00:00
Ted Kremenek d0e32791d5 Update checker build.
llvm-svn: 59206
2008-11-13 01:23:50 +00:00
Ted Kremenek e9c16a6a79 Updated checker build.
llvm-svn: 59195
2008-11-12 23:26:57 +00:00
Sebastian Redl c470476420 Implement C++ 'typeid' parsing and sema.
llvm-svn: 59042
2008-11-11 11:37:55 +00:00
Douglas Gregor cd695e500d Basic support for taking the address of an overloaded function
llvm-svn: 59000
2008-11-10 20:40:00 +00:00
Sebastian Redl e0b2b1bf8c Update C++ status: class support improved due to nested name parsing.
llvm-svn: 58932
2008-11-09 11:32:32 +00:00
Sebastian Redl f4485de48a Update C++ status to reflect parser capabilities for chapter 9 (classes). Slightly extend the class parser test.
llvm-svn: 58909
2008-11-08 15:40:37 +00:00
Sebastian Redl 2e133e47aa Update C++ status: dynamic_cast is sema-complete.
llvm-svn: 58907
2008-11-08 14:43:13 +00:00
Cedric Venet 571c662350 Use css style instead of hard coded color in cxx_status. No visible change.
llvm-svn: 58867
2008-11-07 22:24:44 +00:00
Ted Kremenek 47a6235491 Updated checker build.
llvm-svn: 58864
2008-11-07 20:55:59 +00:00
Douglas Gregor 60e64cfc43 Update C++ status
llvm-svn: 58862
2008-11-07 20:16:04 +00:00
Douglas Gregor 7d5fc7e28b 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.

llvm-svn: 58821
2008-11-06 23:29:22 +00:00
Douglas Gregor 11d0c4c098 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".

llvm-svn: 58817
2008-11-06 22:13:31 +00:00
Ted Kremenek efc44cbf1f Updated checker build.
llvm-svn: 58776
2008-11-05 22:47:25 +00:00
Douglas Gregor 831c93f6c0 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").

llvm-svn: 58767
2008-11-05 20:51:48 +00:00