summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* C1X: implement static assertsPeter Collingbourne2011-04-151-5/+13
| | | | llvm-svn: 129555
* Parse an '@' in an Objective-C++ class member specification,Douglas Gregor2011-04-141-0/+11
| | | | | | | diagnosing it as an error rather than looping infinitely. Also, explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>. llvm-svn: 129521
* Fixup comments.Anders Carlsson2011-03-251-1/+1
| | | | llvm-svn: 128280
* Remove the last of ClassVirtSpecifiers.Anders Carlsson2011-03-251-53/+14
| | | | llvm-svn: 128279
* Replace the call to ParseOptionalCXX0XClassVirtSpecifierSeq with code to ↵Anders Carlsson2011-03-251-5/+18
| | | | | | only parse an optional 'final' keyword. llvm-svn: 128278
* Get rid of handling of the 'explicit' keyword from class-head. We still ↵Anders Carlsson2011-03-251-1/+4
| | | | | | parse it though, although that will change shortly. llvm-svn: 128277
* Remove 'new' from virt-specifier since it's going to be removed in the next ↵Anders Carlsson2011-03-251-4/+0
| | | | | | C++0x draft llvm-svn: 128271
* Insomniac refactoring: change how the parser allocates attributes so thatJohn McCall2011-03-241-19/+17
| | | | | | | | | AttributeLists do not accumulate over the lifetime of parsing, but are instead reused. Also make the arguments array not require a separate allocation, and make availability attributes store their stuff in augmented memory, too. llvm-svn: 128209
* Use ElaboratedType also for C.Abramo Bagnara2011-03-161-7/+5
| | | | llvm-svn: 127755
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-3/+8
| | | | | | | | Change the interface to expose the new information and deal with the enormous fallout. Introduce the new ExceptionSpecificationType value EST_DynamicNone to more easily deal with empty throw specifications. Update the tests for noexcept and fix the various bugs uncovered, such as lack of tentative parsing support. llvm-svn: 127537
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-2/+2
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source ↵Abramo Bagnara2011-03-081-4/+5
| | | | | | range for declarations using postfix types. llvm-svn: 127251
* Fixed NamespaceDecl source range.Abramo Bagnara2011-03-081-2/+2
| | | | llvm-svn: 127242
* Parser support for noexcept specifications.Sebastian Redl2011-03-051-17/+84
| | | | llvm-svn: 127086
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-021-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | template specialization types. This also required some parser tweaks, since we were losing track of the nested-name-specifier's source location information in several places in the parser. Other notable changes this required: - Sema::ActOnTagTemplateIdType now type-checks and forms the appropriate type nodes (+ source-location information) for an elaborated-type-specifier ending in a template-id. Previously, we used a combination of ActOnTemplateIdType and ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped around a DependentTemplateSpecializationType, which duplicated the keyword ("class", "struct", etc.) and nested-name-specifier storage. - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which it places into the returned type-source location information. - Sema::ActOnDependentTag now creates types with source-location information. llvm-svn: 126808
* Reinstate the introduction of source-location information forDouglas Gregor2011-03-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | nested-name-speciciers within elaborated type names, e.g., enum clang::NestedNameSpecifier::SpecifierKind Fixes in this iteration include: (1) Compute the type-source range properly for a dependent template specialization type that starts with "template template-id ::", as in a member access expression dep->template f<T>::f() This is a latent bug I triggered with this change (because now we're checking the computed source ranges for dependent template specialization types). But the real problem was... (2) Make sure to set the qualifier range on a dependent template specialization type appropriately. This will go away once we push nested-name-specifier locations into dependent template specialization types, but it was the source of the valgrind errors on the buildbots. llvm-svn: 126765
* Revert r126748, my second attempt at nested-name-specifier sourceDouglas Gregor2011-03-011-3/+1
| | | | | | location information for elaborated types. *sigh* llvm-svn: 126753
* Reinstate r126737, extending the generation of type-source locationDouglas Gregor2011-03-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | information for qualifier type names throughout the parser to address several problems. The commit message from r126737: Push nested-name-specifier source location information into elaborated name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. llvm-svn: 126748
* When parsing an out-of-line member function declaration, we must delayJohn McCall2011-02-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | access-control diagnostics which arise from the portion of the declarator following the scope specifier, just in case access is granted by friending the individual method. This can also happen with in-line member function declarations of class templates due to templated-scope friend declarations. We were really playing fast-and-loose before with this sort of thing, and it turned out to work because *most* friend functions are in file scope. Making us delay regardless of context exposed several bugs with how we were manipulating delay. I ended up needing a concept of a context that's independent of the declarations in which it appears, and then I actually had to make some things save contexts correctly, but delay should be much cleaner now. I also encapsulated all the delayed-diagnostics machinery in a single subobject of Sema; this is a pattern we might want to consider rolling out to other components of Sema. llvm-svn: 125485
* PR9037: Allow override, final, and new as an extension on inline members.Nico Weber2011-01-281-2/+5
| | | | llvm-svn: 124477
* Get rid of [[hiding]], [[override]] and [[base_check]].Anders Carlsson2011-01-231-4/+1
| | | | llvm-svn: 124087
* Get rid of the [[final]] C++0x attribute.Anders Carlsson2011-01-231-1/+0
| | | | llvm-svn: 124083
* Accept the C++0x override control keywords as an extension in C++98. This is ↵Anders Carlsson2011-01-221-2/+10
| | | | | | OK since the new syntax is unambiguous and can't be confused with C++98 syntax. If anyone disagrees, please shout! llvm-svn: 124048
* Mark classes as final or explicit. Diagnose when a class marked 'final' is ↵Anders Carlsson2011-01-221-1/+2
| | | | | | used as a base. llvm-svn: 124039
* Parse class-virt-specifier-seqs.Anders Carlsson2011-01-221-11/+69
| | | | llvm-svn: 124036
* More work on ClassVirtSpecifiers.Anders Carlsson2011-01-221-1/+1
| | | | llvm-svn: 124035
* Pass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.Anders Carlsson2011-01-201-1/+1
| | | | llvm-svn: 123878
* Lazily initialize the 'final' and 'override' contextual keywords as ↵Anders Carlsson2011-01-201-0/+6
| | | | | | suggested by Doug. llvm-svn: 123876
* Parse the optional semicolon after a C++ in-class member functionDouglas Gregor2011-01-191-0/+12
| | | | | | | definition, rather than complaining about it. Problem reported by Marshall Clow. llvm-svn: 123835
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-181-2/+1
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Remove dead code.Anders Carlsson2011-01-171-5/+0
| | | | llvm-svn: 123612
* Change ParseOptionalCXX0XVirtSpecifierSeq to take a VirtSpecifiers struct.Anders Carlsson2011-01-171-8/+31
| | | | | | | Enforce C++[class.mem]p8: A virt-specifier-seq shall contain at most one of each virt-specifier. llvm-svn: 123611
* Begin work on supporting "N3206: Override control: Eliminating Attributes", fromAnders Carlsson2011-01-161-1/+45
| | | | | | | | | http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm This lands support for parsing virt-specifier-seq after member functions, including the contextual keywords 'final', and 'override'. The keywords are not yet used for anything. llvm-svn: 123606
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-081-1/+1
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
* Implement pack expansion of base initializers, so that we canDouglas Gregor2011-01-041-3/+8
| | | | | | | initialize those lovely mixins that come from pack expansions of base specifiers. llvm-svn: 122793
* Implement pack expansions whose pattern is a base-specifier.Douglas Gregor2011-01-031-1/+8
| | | | llvm-svn: 122782
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-88/+59
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Extend the parser to support pack expansions within exceptionDouglas Gregor2010-12-201-2/+13
| | | | | | | specifications. We can't yet instantiate them, however, since I tripped over PR8835. llvm-svn: 122292
* Added ParenType type node.Abramo Bagnara2010-12-101-1/+1
| | | | llvm-svn: 121488
* Added struct/class syntactic info for c++0x scoped enum.Abramo Bagnara2010-12-031-1/+1
| | | | llvm-svn: 120828
* In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (seeCraig Silverstein2010-11-181-1/+1
| | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=8558). This patch fixes it. Thanks to rjmccall for all the coaching! Approved by rjmccall llvm-svn: 119697
* Region-allocate all AttributeList objects from a factory object instead of ↵Ted Kremenek2010-11-101-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | manually managing them using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up. This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList objects and then blows them away all at once. While conceptually simple, most of the changes in this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications. This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its underlying allocator as we enter/leave key methods in the Parser. This means that we get simple memory management while still having the ability to finely control memory use if necessary. Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic in many large files with attributes. This fixes the leak reported in: <rdar://problem/8650003> llvm-svn: 118675
* Diagnose attempst to template using declarations and using directives.John McCall2010-11-101-14/+42
| | | | | | Recover from the latter and fail early for the former. Fixes PR8022. llvm-svn: 118669
* tidy upChris Lattner2010-11-091-5/+5
| | | | llvm-svn: 118626
* fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange ↵Chris Lattner2010-11-091-1/+0
| | | | | | being constructed. llvm-svn: 118625
* Tag references shouldn't ever get template parameter lists.John McCall2010-10-191-4/+9
| | | | | | Fixes rdar://problem/8568507 llvm-svn: 116843
* Redirect templated friend class decls to a new Sema callback andJohn McCall2010-10-191-3/+14
| | | | | | | construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 llvm-svn: 116786
* Parse default arguments within member functions in source order, fromDouglas Gregor2010-10-121-9/+7
| | | | | | Manuel Klimek! Fixes PR7715. llvm-svn: 116311
* Add parsing support for Microsoft attributes. MS attributes will just be ↵Francois Pichet2010-10-111-0/+26
| | | | | | skipped and not inserted into the AST for now. llvm-svn: 116203
OpenPOWER on IntegriCloud