summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add parsing for references to member function templates with explicitDouglas Gregor2009-08-311-1/+24
| | | | | | | | template argument lists, e.g., x.f<int>(). Semantic analysis will be a separate commit. llvm-svn: 80624
* Support explicit C++ member operator syntax, from James Porter!Douglas Gregor2009-08-311-2/+29
| | | | llvm-svn: 80608
* Address some of Doug's comments.Anders Carlsson2009-08-261-1/+1
| | | | llvm-svn: 80114
* Parsing of pseudo-destructors.Anders Carlsson2009-08-251-8/+24
| | | | llvm-svn: 80055
* Keep track of the right paren ')' source location in a function declarator.Argyrios Kyrtzidis2009-08-191-1/+2
| | | | llvm-svn: 79489
* Implement __is_empty. Patch by Sean Hunt.Eli Friedman2009-08-151-0/+1
| | | | llvm-svn: 79143
* Take 2 on AltiVec-style vector initializers. Nate Begeman2009-08-101-8/+23
| | | | | | | | | | | | Fixes PR4704 problems Addresses Eli's patch feedback re: ugly cast code Updates all postfix operators to remove ParenListExprs. While this is awful, no better solution (say, in the parser) is obvious to me. Better solutions welcome. llvm-svn: 78621
* Revert r78535, it is causing a number of failures to build projects.Daniel Dunbar2009-08-101-23/+8
| | | | | | | | | | | | | | | | | | | | | | | | --- Reverse-merging r78535 into '.': D test/Sema/altivec-init.c U include/clang/Basic/DiagnosticSemaKinds.td U include/clang/AST/Expr.h U include/clang/AST/StmtNodes.def U include/clang/Parse/Parser.h U include/clang/Parse/Action.h U tools/clang-cc/clang-cc.cpp U lib/Frontend/PrintParserCallbacks.cpp U lib/CodeGen/CGExprScalar.cpp U lib/Sema/SemaInit.cpp U lib/Sema/Sema.h U lib/Sema/SemaExpr.cpp U lib/Sema/SemaTemplateInstantiateExpr.cpp U lib/AST/StmtProfile.cpp U lib/AST/Expr.cpp U lib/AST/StmtPrinter.cpp U lib/Parse/ParseExpr.cpp U lib/Parse/ParseExprCXX.cpp llvm-svn: 78551
* AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);Nate Begeman2009-08-091-8/+23
| | | | | | | | In addition to being defined by the AltiVec PIM, this is also the vector initializer syntax used by OpenCL, so that vector literals are compatible with macro arguments. llvm-svn: 78535
* Support nested-name-specifiers for C++ member access expressions, e.g.,Douglas Gregor2009-08-061-1/+15
| | | | | | | | this->Base::foo from James Porter! llvm-svn: 78278
* This patch fixes the implementations of the __has_trivial_destructorDouglas Gregor2009-07-231-0/+2
| | | | | | | | and __has_trivial_constructor builtin pseudo-functions and additionally implements __has_trivial_copy and __has_trivial_assign, from John McCall! llvm-svn: 76916
* Basic support for C++0x unicode types. Support for literals will follow in ↵Alisdair Meredith2009-07-141-0/+2
| | | | | | an incremental patch llvm-svn: 75622
* Preliminary parsing and ASTs for template-ids that refer to functionDouglas Gregor2009-06-301-1/+1
| | | | | | | templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. llvm-svn: 74563
* Fix the parser error hanlding for __builtin_offsetof to actually print Eli Friedman2009-06-271-6/+7
| | | | | | out an error for a malformed __builtin_offsetof. llvm-svn: 74388
* Rework the way we track which declarations are "used" duringDouglas Gregor2009-06-221-3/+6
| | | | | | | | | | | | | | | | | | | | | compilation, and (hopefully) introduce RAII objects for changing the "potentially evaluated" state at all of the necessary places within Sema and Parser. Other changes: - Set the unevaluated/potentially-evaluated context appropriately during template instantiation. - We now recognize three different states while parsing or instantiating expressions: unevaluated, potentially evaluated, and potentially potentially evaluated (for C++'s typeid). - When we're in a potentially potentially-evaluated context, queue up MarkDeclarationReferenced calls in a stack. For C++ typeid expressions that are potentially evaluated, we will play back these MarkDeclarationReferenced calls when we exit the corresponding potentially potentially-evaluated context. - Non-type template arguments are now parsed as constant expressions, so they are not potentially-evaluated. llvm-svn: 73899
* Keep track of when declarations are "used" according to C andDouglas Gregor2009-06-191-1/+21
| | | | | | | | | | | | C++. This logic is required to trigger implicit instantiation of function templates and member functions of class templates, which will be implemented separately. This commit includes support for -Wunused-parameter, printing warnings for named parameters that are not used within a function/Objective-C method/block. Fixes <rdar://problem/6505209>. llvm-svn: 73797
* PR4364: fix parsing 'typename' in an expression.Eli Friedman2009-06-111-1/+7
| | | | llvm-svn: 73177
* Disallow exception specs on typedefs.Sebastian Redl2009-05-311-1/+2
| | | | llvm-svn: 72664
* Reject incomplete types in exception specs.Sebastian Redl2009-05-291-1/+1
| | | | llvm-svn: 72580
* Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate ↵Argyrios Kyrtzidis2009-05-221-3/+34
| | | | | | | | | | | | | | between a parenthesized type-id and a paren expression without considering the context past the parentheses. Behold: (T())x; - type-id (T())*x; - type-id (T())/x; - expression (T()); - expression llvm-svn: 72260
* Factor the compound literal parsing out from ParseParenExpression and into a ↵Argyrios Kyrtzidis2009-05-221-7/+21
| | | | | | | | new ParseCompoundLiteralExpression. No functionality change. llvm-svn: 72259
* Modification to ParseParenExpression.Argyrios Kyrtzidis2009-05-221-16/+25
| | | | | | Now it parses the cast expression unless 'stopIfCastExpr' is true. llvm-svn: 72258
* Refactor the common code of 'ParseTypeofSpecifier' and ↵Argyrios Kyrtzidis2009-05-221-19/+72
| | | | | | | | 'ParseSizeofAlignofExpression' into a new 'ParseExprAfterTypeofSizeofAlignof' method. llvm-svn: 72256
* Merge the ASTVector and ASTOwningVector templates, since they offeredDouglas Gregor2009-05-211-1/+0
| | | | | | | | redundant functionality. The result (ASTOwningVector) lives in clang/Parse/Ownership.h and is used by both the parser and semantic analysis. No intended functionality change. llvm-svn: 72214
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Make the RAII extension warning silencing for __extension__ a bit Eli Friedman2009-05-161-2/+8
| | | | | | | narrower, so it doesn't catch expresions that aren't sub-expressions of __extension__ operator. llvm-svn: 71967
* Fixup __extension__ i = 1 parsing. Thanks Eli!Mike Stump2009-05-161-1/+1
| | | | llvm-svn: 71927
* Fixup parsing for (throw,throw) and __extension__ throw 1.Mike Stump2009-05-151-9/+2
| | | | llvm-svn: 71897
* Implement C++0x nullptr.Sebastian Redl2009-05-101-0/+4
| | | | llvm-svn: 71405
* Remove extra line.Mike Stump2009-04-291-1/+0
| | | | llvm-svn: 70418
* Fixup Sema and CodeGen for block literal attributes when the returnMike Stump2009-04-291-0/+4
| | | | | | | | type and argument types are missing, and let return type deduction happen before we give errors for returning from a noreturn block. Radar 6441502 llvm-svn: 70413
* Sema and CodeGen support for attributes on blocks. Radar 6441502Mike Stump2009-04-291-0/+21
| | | | llvm-svn: 70403
* Have the parser communicate the exception specification to the action.Sebastian Redl2009-04-291-2/+3
| | | | llvm-svn: 70389
* This is a pretty big cleanup for how invalid decl/type are handle.Chris Lattner2009-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix two error paths out of ParseBlockLiteralExpression toChris Lattner2009-04-181-0/+2
| | | | | | | | call ActOnBlockError so that CurBlock gets popped. This fixes a crash on test/block-syntax-error.c when this new assertion is enabled. llvm-svn: 69464
* Add support for the __has_trivial_destructor type trait.Anders Carlsson2009-04-171-1/+2
| | | | llvm-svn: 69345
* Fix a crash bug when comparing overload quality of conversion operators with ↵Sebastian Redl2009-04-161-1/+12
| | | | | | | | | | | 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
* Add support for the __has_trivial_constructor type trait.Anders Carlsson2009-04-161-1/+2
| | | | llvm-svn: 69245
* Fixup whitespacing.Mike Stump2009-04-141-1/+1
| | | | llvm-svn: 69055
* Improve error recovery for calls, fixing:Chris Lattner2009-04-131-3/+8
| | | | | | PR3972: Poor diagnostic with missing ')' llvm-svn: 68932
* Fix http://llvm.org/bugs/show_bug.cgi?id=3907.Steve Naroff2009-04-021-1/+2
| | | | llvm-svn: 68338
* Initial implementation of parsing, semantic analysis, and templateDouglas Gregor2009-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | instantiation for C++ typename-specifiers such as typename T::type The parsing of typename-specifiers is relatively easy thanks to annotation tokens. When we see the "typename", we parse the typename-specifier and produce a typename annotation token. There are only a few places where we need to handle this. We currently parse the typename-specifier form that terminates in an identifier, but not the simple-template-id form, e.g., typename T::template apply<U, V> Parsing of nested-name-specifiers has a similar problem, since at this point we don't have any representation of a class template specialization whose template-name is unknown. Semantic analysis is only partially complete, with some support for template instantiation that works for simple examples. llvm-svn: 67875
* Fix rdar://6719156 - clang should emit a better error when blocks are ↵Chris Lattner2009-03-271-12/+8
| | | | | | | | | disabled but are used anyway by changing blocks from being disabled in the parser to being disabled in Sema. llvm-svn: 67816
* improve error recovery for when type parsing fails.Chris Lattner2009-03-241-1/+5
| | | | llvm-svn: 67626
* Keep track of whether a class is abstract or not. This is currently only ↵Anders Carlsson2009-03-221-0/+1
| | | | | | used for the __is_abstract type trait. llvm-svn: 67461
* Convert a bunch of actions to smart pointers, and also bring ↵Sebastian Redl2009-03-151-8/+6
| | | | | | PrintParserCallbacks a bit more in line with reality. llvm-svn: 67029
* Implement property '.' notation on Factory/Class objects. Parser changes ↵Steve Naroff2009-03-091-0/+22
| | | | | | | | aren't very pretty:-( This fixes <rdar://problem/6496506> Implement class setter/getter for properties. llvm-svn: 66465
* if we crash while parsing a block literal, include it.Chris Lattner2009-03-051-1/+5
| | | | llvm-svn: 66150
* Implemented access check for ivars accessed insideFariborz Jahanian2009-03-041-1/+2
| | | | | | c-style functions declared inside objc @implementations. llvm-svn: 66087
* Introduce code modification hints into the diagnostics system. When weDouglas Gregor2009-02-261-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | know how to recover from an error, we can attach a hint to the diagnostic that states how to modify the code, which can be one of: - Insert some new code (a text string) at a particular source location - Remove the code within a given range - Replace the code within a given range with some new code (a text string) Right now, we use these hints to annotate diagnostic information. For example, if one uses the '>>' in a template argument in C++98, as in this code: template<int I> class B { }; B<1000 >> 2> *b1; we'll warn that the behavior will change in C++0x. The fix is to insert parenthese, so we use code insertion annotations to illustrate where the parentheses go: test.cpp:10:10: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x B<1000 >> 2> *b1; ^ ( ) Use of these annotations is partially implemented for HTML diagnostics, but it's not (yet) producing valid HTML, which may be related to PR2386, so it has been #if 0'd out. In this future, we could consider hooking this mechanism up to the rewriter to actually try to fix these problems during compilation (or, after a compilation whose only errors have fixes). For now, however, I suggest that we use these code modification hints whenever we can, so that we get better diagnostics now and will have better coverage when we find better ways to use this information. This also fixes PR3410 by placing the complaint about missing tokens just after the previous token (rather than at the location of the next token). llvm-svn: 65570
OpenPOWER on IntegriCloud