summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTentative.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-7/+7
| | | | llvm-svn: 81346
* Improve support for out-of-line definitions of nested templates andDouglas Gregor2009-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | their members, including member class template, member function templates, and member classes and functions of member templates. To actually parse the nested-name-specifiers that qualify the name of an out-of-line definition of a member template, e.g., template<typename X> template<typename Y> X Outer<X>::Inner1<Y>::foo(Y) { return X(); } we need to look for the template names (e.g., "Inner1") as a member of the current instantiation (Outer<X>), even before we have entered the scope of the current instantiation. Since we can't do this in general (i.e., we should not be looking into all dependent nested-name-specifiers as if they were the current instantiation), we rely on the parser to tell us when it is parsing a declaration specifier sequence, and, therefore, when we should consider the current scope specifier to be a current instantiation. Printing of complicated, dependent nested-name-specifiers may be somewhat broken by this commit; I'll add tests for this issue and fix the problem (if it still exists) in a subsequent commit. llvm-svn: 80044
* Consider nested-names as part of the declarator when resolving an ambiguous ↵Argyrios Kyrtzidis2009-07-211-1/+5
| | | | | | statement. llvm-svn: 76583
* 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
* Parse the C++0x decltype specifier.Anders Carlsson2009-06-241-1/+6
| | | | llvm-svn: 74086
* Add more parser support for Microsoft extensions.Eli Friedman2009-06-081-1/+4
| | | | llvm-svn: 73101
* Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate ↵Argyrios Kyrtzidis2009-05-221-6/+12
| | | | | | | | | | | | | | 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
* Initial implementation of parsing, semantic analysis, and templateDouglas Gregor2009-03-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | | | disabled but are used anyway by changing blocks from being disabled in the parser to being disabled in Sema. llvm-svn: 67816
* Add parser support for static_assert.Anders Carlsson2009-03-111-4/+4
| | | | llvm-svn: 66661
* Teach the type-id/expression disambiguator about differentDouglas Gregor2009-02-101-11/+26
| | | | | | | | | | | | | | | | | disambiguation contexts, so that we properly parse template arguments such as A<int()> as type-ids rather than as expressions. Since this can be confusing (especially when the template parameter is a non-type template parameter), we try to give a friendly error message. Almost, eliminate a redundant error message (that should have been a note) and add some ultra-basic checks for non-type template arguments. llvm-svn: 64189
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Make tentative parsing of pointer-to-member decls work, and fix other stuff ↵Sebastian Redl2009-01-241-3/+7
| | | | | | pointed out by Doug. llvm-svn: 62944
* Another tweak to handle the MS extensions (<rdar://problem/5956221>).Steve Naroff2009-01-061-0/+1
| | | | llvm-svn: 61821
* Fix <rdar://problem/5956221> clang ObjC rewriter: Microsoft-specific ↵Steve Naroff2009-01-061-0/+6
| | | | | | | | __fastcall keyword unrecognized. This fix is C++ specific. llvm-svn: 61816
* rename tok::annot_qualtypename -> tok::annot_typename, which is bothChris Lattner2009-01-061-1/+1
| | | | | | shorter and more accurate. The type name might not be qualified. llvm-svn: 61788
* push the call in isCXXDeclarationSpecifier to TryAnnotateTypeOrScopeToken Chris Lattner2009-01-041-3/+20
| | | | | | | down into the two cases that it can possibly affect. This avoids calls to it that obviously can't do anything. llvm-svn: 61651
* Removed the warningDouglas Gregor2008-12-171-12/+0
| | | | | | | | | | warning: statement was disambiguated as declaration because it is currently firing in cases where the declaration would not actually parse as a statement. We'd love to bring this warning back if we can make it more accurate. llvm-svn: 61137
* Teach tentative parsing to handle block pointers (rdar://6394309)Chris Lattner2008-11-221-1/+2
| | | | llvm-svn: 59853
* remove the last couple obsolete forms of Parser::Diag.Chris Lattner2008-11-181-6/+6
| | | | llvm-svn: 59510
* Implement support for C++ nested-name-specifiers ('foo::bar::x') in the ↵Argyrios Kyrtzidis2008-11-081-5/+4
| | | | | | | | Parser side. No Sema functionality change, just the signatures of the Action/Sema methods. llvm-svn: 58913
* Just do a diagIfAmbiguous -> warnIfAmbiguous rename.Argyrios Kyrtzidis2008-10-171-3/+3
| | | | | | No functionality change. llvm-svn: 57746
* Issue a warning when there's an ambiguous function declarator (that could be ↵Argyrios Kyrtzidis2008-10-151-4/+10
| | | | | | | | a direct initializer for a variable defition). Idea originated from here: http://thread.gmane.org/gmane.comp.gcc.devel/101524 llvm-svn: 57609
* A tiny optimization; use isCXXFunctionDeclarator only when it's appropriate.Argyrios Kyrtzidis2008-10-051-9/+28
| | | | llvm-svn: 57141
* Add some text from the C++ standard and additional ambiguity resolution tests.Argyrios Kyrtzidis2008-10-051-7/+25
| | | | | | No funcitonality change. llvm-svn: 57136
* Handle ambiguities between expressions and type-ids that occur inside ↵Argyrios Kyrtzidis2008-10-051-3/+56
| | | | | | | | | parentheses, e.g.: sizeof(int()) -> "int()" is type-id sizeof(int()+1) -> "int()+1" is expression. llvm-svn: 57131
* Found a subtle bug caused by an implicit enum-to-bool conversion (of the ↵Argyrios Kyrtzidis2008-10-051-91/+95
| | | | | | | | | | | | TentativeParsingResult enum). This was the motivation of the following changes: -'TentativeParsingResult' enum is replaced by a 'TPResult' class that basically encapsulates the enum. -TPR_true, TPR_false, TPR_ambiguous, and TPR_error enum constants are replaced by TPResult::True(), TPResult::False(), etc. calls that return a TPResult object. -Also fixed the subtle bug in Parser::isCXXFunctionDeclarator (caught by the above changes as a compilation error). llvm-svn: 57125
* Fix Parser::isCXXConditionDeclaration to properly resolve declarations.Argyrios Kyrtzidis2008-10-051-3/+3
| | | | llvm-svn: 57111
* Disambiguate between a declaration or expression for the 'condition' part of ↵Argyrios Kyrtzidis2008-10-051-0/+54
| | | | | | a if/switch/while/for statement. llvm-svn: 57109
* Consider GNU attributes when doing ambiguity resolution.Argyrios Kyrtzidis2008-10-051-6/+15
| | | | llvm-svn: 57108
* Resolve ambiguous C++ statements (C++ 6.8p1).Argyrios Kyrtzidis2008-10-051-0/+720
'ParseTentative.cpp' implements the functionality needed to resolve ambiguous C++ statements, to either a declaration or an expression, by "tentatively parsing" them. llvm-svn: 57084
OpenPOWER on IntegriCloud