summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When checking for a prior declaration of the name of a namespace, skipDouglas Gregor2011-05-061-4/+15
| | | | | | | | any names that aren't in the appropriate identifier namespaces. Fixes an embarrassing bug where we give a redefinition error due to an Objective-C category (<rdar://problem/9388207>). llvm-svn: 131036
* Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.Alexis Hunt2011-05-061-4/+4
| | | | llvm-svn: 131018
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-2/+2
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Do defaulted constructors properly.Alexis Hunt2011-05-061-2/+5
| | | | | | | | 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-10/+4
| | | | | | | direction and not introduce things in the wrong place three different times. llvm-svn: 130968
* Implement support for C++0x alias templates.Richard Smith2011-05-051-4/+96
| | | | llvm-svn: 130953
* Implement some framework for defaulted constructors.Alexis Hunt2011-05-051-4/+10
| | | | | | There's some unused stuff for now. llvm-svn: 130912
* Change cycle detection to be based off of a warning flag.Alexis Hunt2011-05-051-3/+2
| | | | llvm-svn: 130898
* there i fixed itAlexis Hunt2011-05-041-41/+74
| | | | | | | | | Increase robustness of the delegating constructor cycle detection mechanism. No more infinite loops on invalid or logic errors leading to false results. Ensure that this is maintained correctly accross serialization. llvm-svn: 130887
* Implement a better version of delegating constructor cycle detection.Alexis Hunt2011-05-041-20/+57
| | | | | | | | | | | | | This is more efficient as it's all done at once at the end of the TU. This could still get expensive, so a flag is provided to disable it. As an added bonus, the diagnostics will now print out a cycle. The PCH test is XFAILed because we currently can't deal with a note emitted in the header and I, being tired, see no other way to verify the serialization of delegating constructors. We should probably address this problem /somehow/ but no good solution comes to mind. llvm-svn: 130836
* Ensure that delegating constructor loop detection uses canonicalAlexis Hunt2011-05-041-2/+2
| | | | | | declarations. llvm-svn: 130821
* Ensure that destructors are properly inovked when an exception leavesAlexis Hunt2011-05-031-0/+5
| | | | | | | | | | the body of a delegating constructor call. This means that the delegating constructor implementation should be complete and correct, though there are some rough edges (diagnostic quality with the cycle detection and using a deleted destructor). llvm-svn: 130803
* Move the AST modifications to after the cycle detection inAlexis Hunt2011-05-031-6/+12
| | | | | | | lib/Sema/SemaDeclCXX.cpp to avoid getting stuck in an infinite loop. See the comment for more explanation. llvm-svn: 130788
* Remove unused variable, but keep function call with side-effect.Nick Lewycky2011-05-021-1/+1
| | | | llvm-svn: 130678
* Fully implement delegating constructors!Alexis Hunt2011-05-011-0/+28
| | | | | | | | | | As far as I know, this implementation is complete but might be missing a few optimizations. Exceptions and virtual bases are handled correctly. Because I'm an optimist, the web page has appropriately been updated. If I'm wrong, feel free to downgrade its support categories. llvm-svn: 130642
* Synthesizing the definition of an implicit member is an AST modification, so ↵Sebastian Redl2011-04-241-0/+17
| | | | | | notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug. llvm-svn: 130103
* At the end of the translation unit, defining a vtable can introduceDouglas Gregor2011-04-221-1/+3
| | | | | | | | new templates that need to be instantiated and vice-versa. Iterate until we've instantiated all required templates and defined all required vtables. Fixed PR9325 / <rdar://problem/9055177>. llvm-svn: 130023
* Add -fdelayed-template-parsing option. Using this option all templated ↵Francois Pichet2011-04-221-0/+19
| | | | | | | | | function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup. Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
* 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
OpenPOWER on IntegriCloud