summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support dependent extended vector types and template instantiationDouglas Gregor2009-06-171-1/+1
| | | | | | thereof. Patch by Anders Johnsen! llvm-svn: 73641
* Handle temporaries in default arguments.Anders Carlsson2009-06-161-1/+4
| | | | llvm-svn: 73462
* It's an error to use a function declared in a class definition as a default ↵Anders Carlsson2009-06-121-3/+12
| | | | | | argument before the function has been declared. llvm-svn: 73234
* Make ParmVarDecl::getDefaultArg() more robust, it now asserts that the ↵Anders Carlsson2009-06-061-1/+1
| | | | | | argument is not unparsed. Add a new hasDefaultArg() and use it in places where getDefaultArg() was called when the argument was unparsed. llvm-svn: 72984
* Remove VarDecl from CXXConstructExpr.Anders Carlsson2009-05-301-1/+1
| | | | llvm-svn: 72633
* Pretty printing and improved representation for namespace alias declarationsDouglas Gregor2009-05-301-1/+3
| | | | llvm-svn: 72616
* Printing for using directives, e.g.,Douglas Gregor2009-05-301-2/+6
| | | | | | | | | using namespace std::debug; Extended UsingDirectiveDecl to store the nested-name-specifier that precedes the nominated namespace. llvm-svn: 72614
* Reimplement much of the way that we track nested classes in theDouglas Gregor2009-05-271-0/+17
| | | | | | | | | | | | | parser. Rather than placing all of the delayed member function declarations and inline definitions into a single bucket corresponding to the top-level class, we instead mirror the nesting structure of the nested classes and place the delayed member functions into their appropriate place. Then, when we actually parse the delayed member function declarations, set up the scope stack the same way as it was when we originally saw the declaration, so that we can find, e.g., template parameters that are in scope. llvm-svn: 72502
* Reintroduce the home for exception specs, and make Sema fill it. However, ↵Sebastian Redl2009-05-271-0/+3
| | | | | | keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere. llvm-svn: 72498
* When evaluating a VarDecl as a constant or determining whether it isDouglas Gregor2009-05-261-1/+1
| | | | | | | | an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
* When assigning from an rvalue to a const reference, the implicit cast from T ↵Anders Carlsson2009-05-191-1/+1
| | | | | | -> const T is not an lvalue cast. llvm-svn: 72082
* Deal with an icky corner case where we were complaining that a catchDouglas Gregor2009-05-181-1/+1
| | | | | | | | | statement was using an rvalue reference during the template definition. However, template instantiations based on an lvalue reference type are well-formed, so we delay checking of these property until template instantiation time. llvm-svn: 72041
* Template instantiation for C++ try/catch statements.Douglas Gregor2009-05-181-18/+42
| | | | llvm-svn: 72035
* Rewrite PureVirtualMethodCollector to use the overridden methods. Fixes ↵Anders Carlsson2009-05-171-22/+26
| | | | | | <rdar://problem/6854087> llvm-svn: 71970
* Reflow some comments.Mike Stump2009-05-161-18/+16
| | | | llvm-svn: 71936
* Better diagnostics for covariance when checking overriding return types.Anders Carlsson2009-05-141-6/+65
| | | | llvm-svn: 71786
* Add return type checking for overriding virtual functions. We currently ↵Anders Carlsson2009-05-141-0/+22
| | | | | | don't check covariance but that's next. llvm-svn: 71759
* Friend declarations are only valid inside class definitions.Anders Carlsson2009-05-111-0/+9
| | | | llvm-svn: 71489
* Implement the notions of the "current instantiation" and "unknownDouglas Gregor2009-05-111-2/+2
| | | | | | | | | | | | | | | | | | specialization" within a C++ template, and permit name lookup into the current instantiation. For example, given: template<typename T, typename U> struct X { typedef T type; X* x1; // current instantiation X<T, U> *x2; // current instantiation X<U, T> *x3; // not current instantiation ::X<type, U> *x4; // current instantiation X<typename X<type, U>::type, U>: *x5; // current instantiation }; llvm-svn: 71471
* Back out r70506 (exception spec in AST) again. We won't have exception specs ↵Sebastian Redl2009-05-061-3/+0
| | | | | | until we've had a lot more discussion. llvm-svn: 71125
* When determining whether an expression refers to a bit-field, lookDouglas Gregor2009-05-021-1/+1
| | | | | | | | | into the left-hand side of an assignment expression. This completes most of PR3500; the only remaining part is to deal with the GCC-specific implementation-defined behavior for "unsigned long" (and other) bit-fields. llvm-svn: 70623
* Replace a bunch of static_cast + release with takeAs.Anders Carlsson2009-05-011-1/+1
| | | | llvm-svn: 70566
* C++ destructors can have a single unnamed void parameter. Fixes ↵Anders Carlsson2009-04-301-1/+8
| | | | | | <rdar://problem/6841210>. llvm-svn: 70519
* Rework the way we handle constructor decls to be less hacky and fix PR3948 ↵Anders Carlsson2009-04-301-13/+0
| | | | | | completely. llvm-svn: 70516
* Make a home for exception specs in the AST. Now Sema can hook them up.Sebastian Redl2009-04-301-0/+3
| | | | llvm-svn: 70506
* Track down return statements in the handlers of a function-try-block of ↵Sebastian Redl2009-04-271-0/+21
| | | | | | constructors. Meh ... llvm-svn: 70256
* Don't allow catch declarations to name an abstract classSebastian Redl2009-04-271-0/+5
| | | | llvm-svn: 70248
* change a couple more c++ sema methods to be based on isinvalid bits.Chris Lattner2009-04-251-22/+18
| | | | llvm-svn: 70022
* various "is invalid" cleanups for C++ ctors/dtors.Chris Lattner2009-04-251-47/+48
| | | | llvm-svn: 70021
* This is a pretty big cleanup for how invalid decl/type are handle.Chris Lattner2009-04-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of a bunch of random InvalidDecl bools in sema, changing us to use the following approach: 1. When analyzing a declspec or declarator, if an error is found, we set a bit in Declarator saying that it is invalid. 2. Once the Decl is created by sema, we immediately set the isInvalid bit on it from what is in the declarator. From this point on, sema consistently looks at and sets the bit on the decl. This gives a very clear separation of concerns and simplifies a bunch of code. In addition to this, this patch makes these changes: 1. it renames DeclSpec::getInvalidType() -> isInvalidType(). 2. various "merge" functions no longer return bools: they just set the invalid bit on the dest decl if invalid. 3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator methods now set invalid on the decl returned instead of returning an invalid bit byref. 4. In SemaType, refering to a typedef that was invalid now propagates the bit into the resultant type. Stuff declared with the invalid typedef will now be marked invalid. 5. Various methods like CheckVariableDeclaration now return void and set the invalid bit on the decl they check. There are a few minor changes to tests with this, but the only major bad result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this next. llvm-svn: 70020
* Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in ↵Anders Carlsson2009-04-241-5/+2
| | | | | | InitializeVarWithConstructor. llvm-svn: 69956
* Implement lvalue test for conditional expressions.Sebastian Redl2009-04-171-0/+2
| | | | | | Add a few commented lines to the test case that point out things that don't work yet. llvm-svn: 69354
* Add support for the __has_trivial_destructor type trait.Anders Carlsson2009-04-171-3/+15
| | | | llvm-svn: 69345
* If a class has a non-trivial constructor that doesn't take any arguments, we ↵Anders Carlsson2009-04-161-10/+14
| | | | | | | | | | | | | | | | | | will now make an implicit CXXTemporaryObjectExpr. So struct S { S(); }; void f() { S s; } 's' here will implicitly be declared as. S s = S(); llvm-svn: 69326
* Fix a crash bug when comparing overload quality of conversion operators with ↵Sebastian Redl2009-04-161-1/+1
| | | | | | | | | | | conversion constructors. Remove an atrocious amount of trailing whitespace in the overloaded operator mangler. Sorry, couldn't help myself. Change the DeclType parameter of Sema::CheckReferenceInit to be passed by value instead of reference. It wasn't changed anywhere. Let the parser handle C++'s irregular grammar around assignment-expression and conditional-expression. And finally, the reason for all this stuff: implement C++ semantics for the conditional operator. The implementation is complete except for determining lvalueness. llvm-svn: 69299
* When we create an implicit CXXTemporaryObjectExpr we don't need to check ↵Anders Carlsson2009-04-161-6/+1
| | | | | | that it's a valid init. Instead, just set it as the VarDecl's initializer. llvm-svn: 69292
* Disable the code I added before until I understand what's causing ↵Anders Carlsson2009-04-161-0/+5
| | | | | | default2.cpp to fail. llvm-svn: 69267
* Add support for the __has_trivial_constructor type trait.Anders Carlsson2009-04-161-0/+30
| | | | llvm-svn: 69245
* When declaring a variable that has a constructor and a direct initializer, ↵Anders Carlsson2009-04-151-9/+13
| | | | | | | | | | | | | | | | | | for example: struct X { X(int, int); }; X x(10, 10); we model that as X x = X(10, 10); inserting a temporary object expr. llvm-svn: 69227
* fix some out of date comments pointed out by SebastianChris Lattner2009-04-121-2/+1
| | | | llvm-svn: 68923
* Parse deleted member functions. Parsing member declarations goes through a ↵Sebastian Redl2009-04-121-3/+7
| | | | | | | | | different code path that I forgot previously. Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now. The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though. llvm-svn: 68902
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-18/+23
| | | | | | No functionality change (really). llvm-svn: 68726
* Introduce a "-fixit" mode to clang-cc that applies code-modification hints.Douglas Gregor2009-04-021-1/+1
| | | | llvm-svn: 68268
* Add some more code modification hintsDouglas Gregor2009-04-011-2/+3
| | | | llvm-svn: 68261
* Push DeclGroup much farther throughout the compiler. Now the variousChris Lattner2009-03-291-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | productions (except the already broken ObjC cases like @class X,Y;) in the parser that can produce more than one Decl return a DeclGroup instead of a Decl, etc. This allows elimination of the Decl::NextDeclarator field, and exposes various clients that should look at all decls in a group, but which were only looking at one (such as the dumper, printer, etc). These have been fixed. Still TODO: 1) there are some FIXME's in the code about potentially using DeclGroup for better location info. 2) ParseObjCAtDirectives should return a DeclGroup due to @class etc. 3) I'm not sure what is going on with StmtIterator.cpp, or if it can be radically simplified now. 4) I put a truly horrible hack in ParseTemplate.cpp. I plan to bring up #3/4 on the mailing list, but don't plan to tackle #1/2 in the short term. llvm-svn: 68002
* Reintroduce r67870 (rval ref overloading), since I can't reproduce any test ↵Sebastian Redl2009-03-291-22/+38
| | | | | | failures on i386 or x86_64. If this fails for someone, please contact me. llvm-svn: 67999
* various cleanupsChris Lattner2009-03-291-2/+1
| | | | llvm-svn: 67981
* More improvements to namespace aliases. We now support everything except ↵Anders Carlsson2009-03-281-4/+18
| | | | | | aliases in using directives. llvm-svn: 67966
* Fix lookup bugAnders Carlsson2009-03-281-1/+1
| | | | llvm-svn: 67964
* Create AST nodes for namespace aliases.Anders Carlsson2009-03-281-1/+6
| | | | llvm-svn: 67962
OpenPOWER on IntegriCloud