summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Do defaulted constructors properly.Alexis Hunt2011-05-061-1/+10
| | | | | | | | Explictly defaultedness is correctly reflected on the AST, but there are no changes to how that affects the definition of functions or much else really. llvm-svn: 130974
* Revert r130912 in order to approach defaulted functions from the otherAlexis Hunt2011-05-061-13/+1
| | | | | | | direction and not introduce things in the wrong place three different times. llvm-svn: 130968
* Slight tweak to alias template error handling: don't guess that a ↵Richard Smith2011-05-051-1/+2
| | | | | | template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic. llvm-svn: 130961
* Implement support for C++0x alias templates.Richard Smith2011-05-051-11/+37
| | | | llvm-svn: 130953
* Implement some framework for defaulted constructors.Alexis Hunt2011-05-051-1/+13
| | | | | | There's some unused stuff for now. llvm-svn: 130912
* When parsing a template friend declaration we dropped the templateChandler Carruth2011-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | parameters on the floor in certain cases: class X { template <typename T> friend typename A<T>::Foo; }; This was parsed as a *non* template friend declaration some how, and received an ExtWarn. Fixing the parser to actually provide the template parameters to the freestanding declaration parse triggers the code which specifically looks for such constructs and hard errors on them. Along the way, this prevents us from trying to instantiate constructs like the above inside of a outer template. This is important as loosing the template parameters means we don't have a well formed declaration and template instantiation will be unable to rebuild the AST. That fixes a crash in the GCC test suite. llvm-svn: 130772
* Fixed source range for extern linkage specification without braces.Abramo Bagnara2011-05-011-0/+5
| | | | llvm-svn: 130660
* White-list yet more type trait names, since they're used asDouglas Gregor2011-04-291-10/+20
| | | | | | identifiers in libc++. llvm-svn: 130508
* libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our ↵Douglas Gregor2011-04-291-1/+2
| | | | | | new type trait __is_same llvm-svn: 130468
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-281-0/+2
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* t/clang/type-traitsJohn Wiegley2011-04-271-16/+13
| | | | | | | | | | Patch authored by John Wiegley. These type traits are used for parsing code that employs certain features of the Embarcadero C++ compiler. Several of these constructs are also desired by libc++, according to its project pages (such as __is_standard_layout). llvm-svn: 130342
* Make the invalid declarator recovery when parsing members work the same as ↵Sebastian Redl2011-04-241-1/+1
| | | | | | when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case. llvm-svn: 130101
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-10/+44
| | | | llvm-svn: 129567
* 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
OpenPOWER on IntegriCloud