summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Don't enter a qualified scope for an invalid decl.Argyrios Kyrtzidis2011-04-221-2/+2
| | | | | | Fixes assertion later on. rdar://9122937 & http://llvm.org/PR9459 llvm-svn: 130006
* For consistency, change suffix from war_ to warn_ for some Microsoft ↵Francois Pichet2011-04-221-1/+1
| | | | | | warnings I introduced lately. llvm-svn: 129986
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-4/+59
| | | | llvm-svn: 129567
* Refactor 129240 to merge the old default argument into the new parameter.Francois Pichet2011-04-101-5/+13
| | | | llvm-svn: 129242
* MSVC accepts that default parameters be redefined for member functionsFrancois Pichet2011-04-101-3/+14
| | | | | | | | of template class. The new value is ignored. This fixes 1 error when parsing MSVC 2010 header files with clang. llvm-svn: 129240
* Use ExprResult& instead of Expr *& in SemaJohn Wiegley2011-04-081-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This patch authored by Eric Niebler. Many methods on the Sema class (e.g. ConvertPropertyForRValue) take Expr pointers as in/out parameters (Expr *&). This is especially true for the routines that apply implicit conversions to nodes in-place. This design is workable only as long as those conversions cannot fail. If they are allowed to fail, they need a way to report their failures. The typical way of doing this in clang is to use an ExprResult, which has an extra bit to signal a valid/invalid state. Returning ExprResult is de riguour elsewhere in the Sema interface. We suggest changing the Expr *& parameters in the Sema interface to ExprResult &. This increases interface consistency and maintainability. This interface change is important for work supporting MS-style C++ properties. For reasons explained here <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-February/013180.html>, seemingly trivial operations like rvalue/lvalue conversions that formerly could not fail now can. (The reason is that given the semantics of the feature, getter/setter method lookup cannot happen until the point of use, at which point it may be found that the method does not exist, or it may have the wrong type, or overload resolution may fail, or it may be inaccessible.) llvm-svn: 129143
* Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a ↵Nico Weber2011-04-021-1/+1
| | | | | | non-header file. llvm-svn: 128780
* Fix PR9572 and neighboring lurking crashers.Matt Beaumont-Gay2011-03-281-2/+13
| | | | llvm-svn: 128401
* Reduce indentation using early exits and add a couple of comments. NoChandler Carruth2011-03-271-17/+22
| | | | | | functionality changed. llvm-svn: 128396
* Improve -Wheader-hygiene to warn about using directives inside linkageDouglas Gregor2011-03-261-1/+14
| | | | | | specifications within the global scope, from Elliot Glaysher. llvm-svn: 128352
* Fixup comments.Anders Carlsson2011-03-251-4/+3
| | | | llvm-svn: 128280
* Get rid of handling of the 'explicit' keyword from class-head. We still ↵Anders Carlsson2011-03-251-20/+0
| | | | | | parse it though, although that will change shortly. llvm-svn: 128277
* Apply the nonnull attribute to constructor expressions too.Nick Lewycky2011-03-251-0/+7
| | | | llvm-svn: 128253
* Add a new warning for exit-time destructors.Anders Carlsson2011-03-241-3/+7
| | | | llvm-svn: 128188
* Fix Objective-C++ exceptions (GNU runtime).David Chisnall2011-03-201-4/+1
| | | | llvm-svn: 127980
* Add an opt-in -Wheader-hygiene, which current diagnoses the use ofDouglas Gregor2011-03-181-0/+6
| | | | | | global using directives in C++ headers, from Elliot Glaysher! llvm-svn: 127881
* Fixed inconsistency when adding TemplateParameterListsInfo.Abramo Bagnara2011-03-181-5/+2
| | | | llvm-svn: 127876
* Fix PR9488: 'auto' type substitution can fail (for instance, if it creates a ↵Richard Smith2011-03-171-3/+5
| | | | | | | | reference-to-void type). Don't crash if it does. Also fix an issue where type source information for the resulting type was being lost. llvm-svn: 127811
* Instead of storing an ASTContext* in FunctionProtoTypes with computed ↵Sebastian Redl2011-03-131-1/+1
| | | | | | noexcept specifiers, unique FunctionProtoTypes with a ContextualFoldingSet, as suggested by John McCall. llvm-svn: 127568
* Revert "Disable delegating constructors for 2.9"Sebastian Redl2011-03-121-5/+1
| | | | | | It is only meant for the release branch. llvm-svn: 127544
* Disable delegating constructors for 2.9Sebastian Redl2011-03-121-1/+5
| | | | llvm-svn: 127543
* Revert "Disable inherited constructors for 2.9."Sebastian Redl2011-03-121-7/+3
| | | | | | It is only meant for the release branch. llvm-svn: 127542
* Disable inherited constructors for 2.9.Sebastian Redl2011-03-121-3/+7
| | | | llvm-svn: 127541
* Propagate the new exception information to FunctionProtoType.Sebastian Redl2011-03-121-51/+133
| | | | | | | | 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
* Forgotten part of previous commit.Abramo Bagnara2011-03-121-1/+5
| | | | llvm-svn: 127536
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-1/+1
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* Avoid do drop outer template parameter lists on the floor.Abramo Bagnara2011-03-101-2/+4
| | | | llvm-svn: 127404
* Teach libclang's token-annotation logic about context-sensitiveDouglas Gregor2011-03-081-1/+8
| | | | | | keywords for Objective-C+ and C++0x. llvm-svn: 127253
* Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source ↵Abramo Bagnara2011-03-081-7/+9
| | | | | | range for declarations using postfix types. llvm-svn: 127251
* Fixed NamespaceDecl source range.Abramo Bagnara2011-03-081-5/+7
| | | | llvm-svn: 127242
* Fixed source range for all DeclaratorDecl's.Abramo Bagnara2011-03-081-25/+29
| | | | llvm-svn: 127225
* Reinstate r127112, "Propagate new-style exception spec information to ↵Sebastian Redl2011-03-061-9/+13
| | | | | | ExtProtoInfo.", this time with the missing header. llvm-svn: 127118
* Revert r127112, "Propagate new-style exception spec information to ↵NAKAMURA Takumi2011-03-061-13/+9
| | | | | | | | ExtProtoInfo." It seems missing "clang/Basic/ExceptionSpecificationType.h". llvm-svn: 127115
* Propagate new-style exception spec information to ExtProtoInfo.Sebastian Redl2011-03-051-9/+13
| | | | llvm-svn: 127112
* Move private structs into anonymous namespaces.Benjamin Kramer2011-03-041-6/+8
| | | | llvm-svn: 126997
* -Woverloaded-virtual shouldn't warn for static functions. Fixes ↵Argyrios Kyrtzidis2011-03-031-1/+2
| | | | | | rdar://9083431 & http://llvm.org/PR9396. llvm-svn: 126966
* Removed left brace location from LinkageSpecDecl.Abramo Bagnara2011-03-031-2/+1
| | | | llvm-svn: 126945
* Fixed end source location for LinkageSpecDecl.Abramo Bagnara2011-03-031-4/+9
| | | | llvm-svn: 126943
* Reinstate the introduction of source-location information forDouglas Gregor2011-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | location information for elaborated types. *sigh* llvm-svn: 126753
* Reinstate r126737, extending the generation of type-source locationDouglas Gregor2011-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r126737, the most recent nested-name-specifier location change, for ↵Douglas Gregor2011-03-011-1/+1
| | | | | | buildbot breakage. llvm-svn: 126746
* Push nested-name-specifier source location information into elaboratedDouglas Gregor2011-03-011-1/+1
| | | | | | | | | | | | | | | | | | | 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: 126737
* Push nested-name-specifier source location information intoDouglas Gregor2011-03-011-4/+4
| | | | | | | | | | | | DependentNameTypeLoc. Teach the recursive AST visitor and libclang how to walk DependentNameTypeLoc nodes. Also, teach libclang about TypedefDecl source ranges, so that we get those. The massive churn in test/Index/recursive-cxx-member-calls.cpp is a good thing: we're annotating a lot more of this test correctly now. llvm-svn: 126729
* Teach Sema::CheckTypenameType to use nested-name-specifiers withDouglas Gregor2011-02-281-6/+6
| | | | | | | | source-location information. We don't actually preserve this information in any of the resulting TypeLocs (yet), so it doesn't matter. llvm-svn: 126693
* Push nested-name-specifier location information into DeclRefExpr andDouglas Gregor2011-02-281-2/+2
| | | | | | MemberExpr, the last of the expressions with qualifiers! llvm-svn: 126688
* Implement delegating constructors partially.Alexis Hunt2011-02-261-8/+61
| | | | | | | | | | | This successfully performs constructor lookup and verifies that a delegating initializer is the only initializer present. This does not perform loop detection in the initialization, but it also doesn't codegen delegating constructors at all, so this won't cause runtime infinite loops yet. llvm-svn: 126552
* Push nested-name-specifier source location information into namespaceDouglas Gregor2011-02-251-2/+1
| | | | | | aliases. llvm-svn: 126496
* Push nested-name-specifier source location information into using directives.Douglas Gregor2011-02-251-4/+2
| | | | llvm-svn: 126489
* Update UsingDecl, UnresolvedUsingTypenameDecl, andDouglas Gregor2011-02-251-17/+14
| | | | | | | | | | | | | | UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the extremely-lossy NestedNameSpecifier/SourceRange pair it used to use, improving source-location information. Various infrastructure updates to support NestedNameSpecifierLoc: - AST/PCH (de-)serialization - Recursive AST visitor - libclang traversal (including the first tests of this functionality) llvm-svn: 126459
OpenPOWER on IntegriCloud