Commit Graph

71 Commits

Author SHA1 Message Date
Douglas Gregor a1f4997368 Semantic analysis for explicit instantiation of class templates. We
still aren't instantiating the definitions of class template members,
and core issues 275 and 259 will both affect the checking that we do
for explicit instantiations (but are not yet implemented).

llvm-svn: 71613
2009-05-13 00:25:59 +00:00
Douglas Gregor 1b57ff32a8 Implement parsing for explicit instantiations of class templates, e.g.,
template class X<int>;

This also cleans up the propagation of template information through
declaration parsing, which is used to improve some diagnostics.

llvm-svn: 71608
2009-05-12 23:25:50 +00:00
Douglas Gregor 9e0d21a444 Align the N/A in the C++ status table, from Anders Johnsen
llvm-svn: 71576
2009-05-12 18:36:58 +00:00
Douglas Gregor 5a4d12afbf Fill in more C++ status. We're now using the check mark to mean,
"complete, and we have tests for every paragraph".

llvm-svn: 71564
2009-05-12 17:55:28 +00:00
Sebastian Redl 9257b234a5 Update minor points in C++ status table.
llvm-svn: 71406
2009-05-10 20:06:11 +00:00
Sebastian Redl 576fd424df Implement C++0x nullptr.
llvm-svn: 71405
2009-05-10 18:38:11 +00:00
Douglas Gregor 1bbffbceae Big update to the C++ status table to reflect "recent"
development. Still much more to write!

llvm-svn: 71167
2009-05-07 17:50:16 +00:00
Sebastian Redl 2b9cacbffa Have the parser communicate the exception specification to the action.
llvm-svn: 70389
2009-04-29 17:30:04 +00:00
Sebastian Redl 4c018663b2 Track down return statements in the handlers of a function-try-block of constructors. Meh ...
llvm-svn: 70256
2009-04-27 21:33:24 +00:00
Sebastian Redl 4de47b445b Improve validation of C++ exception handling: diagnose throwing incomplete types and jumps into protected try-catch scopes.
llvm-svn: 70242
2009-04-27 20:27:31 +00:00
Sebastian Redl 21b349d5ea Fill in the C++ status table for exceptions
llvm-svn: 70217
2009-04-27 18:25:15 +00:00
Sebastian Redl 8ce189f9ce Conditional operator C++ checking complete. What issues remain are in more general code.
llvm-svn: 69555
2009-04-19 21:53:20 +00:00
Sebastian Redl d1309a3c4d Add deleted functions and rvalue references to C++ status.
llvm-svn: 68903
2009-04-12 17:41:24 +00:00
Anders Carlsson 452e1c8a6a We fully support namespace aliases now.
llvm-svn: 68116
2009-03-31 17:17:14 +00:00
Anders Carlsson b6da73f2e0 class.abstract is complete. Anything that doesn't work is a bug.
llvm-svn: 67595
2009-03-24 01:24:06 +00:00
Douglas Gregor 2460c0c37c Link from the C++ status page to the open projects page
llvm-svn: 67399
2009-03-20 20:39:57 +00:00
Anders Carlsson bd1a1d2fa6 We support static_assert.
llvm-svn: 67043
2009-03-16 17:28:26 +00:00
Douglas Gregor 83e9e91479 Note some advances in our C++ support
llvm-svn: 66742
2009-03-12 00:09:31 +00:00
Gabor Greif dd4ddf13a6 fix (hopefully) some validation errors
llvm-svn: 65455
2009-02-25 15:22:45 +00:00
Cedric Venet 08438133da Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

llvm-svn: 64564
2009-02-14 20:20:19 +00:00
Sebastian Redl f3b5e27fee Make const-initialized const integral variables I-C-Es in C++.
llvm-svn: 64015
2009-02-07 13:06:23 +00:00
Sebastian Redl 779dd9382d Fill in C++ status table for section 7 (declarations).
llvm-svn: 64013
2009-02-07 12:42:13 +00:00
Sebastian Redl 112a976616 Implement dereferencing of pointers-to-member.
llvm-svn: 63983
2009-02-07 00:15:38 +00:00
Sebastian Redl 18f8ff62a3 Implement taking address of member functions, including overloaded ones.
llvm-svn: 63779
2009-02-04 21:23:32 +00:00
Douglas Gregor 7bad6d1d32 Argument Dependent Lookup is done (for now). Also, update the status
for a few other name-lookup sections.

llvm-svn: 63734
2009-02-04 15:07:16 +00:00
Douglas Gregor d14247a9e5 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.

llvm-svn: 63431
2009-01-30 22:09:00 +00:00
Sebastian Redl ed8f200318 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.

llvm-svn: 63215
2009-01-28 18:33:18 +00:00
Douglas Gregor fb03466388 Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.

llvm-svn: 63211
2009-01-28 17:15:10 +00:00
Sebastian Redl a5a77a6dc6 Add handling of member pointers to reinterpret_cast.
llvm-svn: 63150
2009-01-27 23:18:31 +00:00
Sebastian Redl b44ab5f25d Add support for member pointers to const_cast.
llvm-svn: 63055
2009-01-26 22:19:12 +00:00
Sebastian Redl cf8e1fa58e Update C++ status table with new member pointer conversion capabilities.
llvm-svn: 62977
2009-01-26 00:11:25 +00:00
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
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
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
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
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
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
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
Sebastian Redl c470476420 Implement C++ 'typeid' parsing and sema.
llvm-svn: 59042
2008-11-11 11:37:55 +00:00