summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Track in the AST whether a function is constexpr.Richard Smith2011-08-151-5/+12
| | | | llvm-svn: 137653
* Implement function template specialization at class scope extension in ↵Francois Pichet2011-08-141-1/+2
| | | | | | | | | | | | | | | | | Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization. Example: template <class T> class A { public: template <class U> void f(U p) { } template <> void f(int p) { } // <== class scope specialization }; This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code. BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error. llvm-svn: 137573
* When adding the base and member initializers for an implicitly-definedDouglas Gregor2011-08-101-1/+2
| | | | | | | special member function, make sure to classify an explicitly-defaulted copy constructor as a "copy" operation. Fixes PR10622. llvm-svn: 137219
* Rewrite default initialization of anonymous structs/unions within aDouglas Gregor2011-08-101-69/+111
| | | | | | | | | | | | | constructor. Previously, we did some bogus recursion into the fields of anonymous structs (recursively), which ended up building invalid ASTs that would cause CodeGen to crash due to invalid GEPs. Now, we instead build the default initializations based on the indirect field declarations at the top level, which properly generates the sequence of GEPs needed to initialize the proper member. Fixes PR10512 and <rdar://problem/9924046>. llvm-svn: 137212
* Don't emit memcpy for copying fields of arrays of volatile elements.Fariborz Jahanian2011-08-091-2/+2
| | | | | | | Use the the path that generates a loop. This fixes bogus error that clang puts out. // rdar://9894548 llvm-svn: 137080
* Lazily deserialize Sema::VTableUses. Plus, fix the utterly andDouglas Gregor2011-07-281-0/+26
| | | | | | | | completely broken deserialization mapping code we had for VTableUses, which would have broken horribly as soon as our local-to-global ID mapping became interesting. llvm-svn: 136371
* Turn Sema::DelegatingCtorDecls into a LazyVector.Douglas Gregor2011-07-271-2/+2
| | | | llvm-svn: 136273
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-251-1/+1
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-15/+15
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Speculatively revert 135649 to bring back the g++ testing bots.Eric Christopher2011-07-211-6/+4
| | | | llvm-svn: 135668
* When copping out on a friend template declaration, be sure to mark itsAlexis Hunt2011-07-211-4/+6
| | | | | | access specifier as public. llvm-svn: 135649
* Replace r134583's fix for PR10290 with one which also works for ↵Richard Smith2011-07-201-2/+3
| | | | | | non-value-dependent cases. llvm-svn: 135543
* Eliminate an incomplete/incorrect attempt to provide support for C++0xDouglas Gregor2011-07-131-5/+2
| | | | | | | unrestricted unions, which ended up attempting to initialize objects in a union (which CodeGen isn't prepared for). Fixes PR9683. llvm-svn: 135027
* Fix a bug where a local variable named 'self' is causingFariborz Jahanian2011-07-121-0/+1
| | | | | | | implicit ivar accesses to go through the 'self' variable rather than the real 'self' for the method. // rdar://9730771 llvm-svn: 134992
* Fixed PR10243.Abramo Bagnara2011-07-111-6/+16
| | | | llvm-svn: 134892
* Don't try to type-check a copy construction of an exceptionDouglas Gregor2011-07-061-1/+1
| | | | | | | declaration with dependent type. Fixes PR10232 / <rdar://problem/9700653>. llvm-svn: 134515
* ActOnCXXConditionDeclaration should take into account thatDouglas Gregor2011-07-051-1/+4
| | | | | | ActOnDeclarator can return NULL. Fixes PR10270, from Hans Wennborg! llvm-svn: 134416
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-281-56/+55
| | | | | | | | | | | | | | | vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
* Remove the call to GetTypeForDeclarator in Sema::ActOnCXXConditionDeclaration.Argyrios Kyrtzidis2011-06-281-16/+4
| | | | | | No functionality change. llvm-svn: 133984
* Fix a couple more issues related to r133854:Richard Smith2011-06-251-8/+1
| | | | | | | | When performing semantic analysis on a member declaration, fix the check for whether we are declaring a function to check for parenthesized declarators, declaration via decltype, etc. Also fix the semantic check to not treat FuncType* as a function type. llvm-svn: 133862
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-8/+2
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-221-2/+6
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* Changes ParenListExpr to always require a type.Manuel Klimek2011-06-221-24/+11
| | | | | | | Removes dead code found in the process. Adds a test to verify that ParenListExprs do not have NULL types. llvm-svn: 133637
* Ensure that we delete implict copy members when explicit move membersAlexis Hunt2011-06-221-2/+14
| | | | | | are also present. llvm-svn: 133593
* Attempt to reapply this patch for caching copy assignment operatorAlexis Hunt2011-06-211-187/+82
| | | | | | | lookup. Previously, it was breaking self-host, but it's been a week and a half and I can't reproduce, so I need to see if it's still failing. llvm-svn: 133581
* De-Unicode-ify in comments.NAKAMURA Takumi2011-06-211-3/+3
| | | | llvm-svn: 133501
* When synthesizing implicit copy/move constructors and copy/move assignmentJohn McCall2011-06-171-5/+14
| | | | | | | operators, don't make an initializer or sub-operation for zero-width bitfields. llvm-svn: 133221
* Automatic Reference Counting.John McCall2011-06-151-23/+22
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-28/+201
| | | | llvm-svn: 132878
* This change is breaking selfhost. Revert it until I have more timeAlexis Hunt2011-06-101-82/+187
| | | | | | to study it. llvm-svn: 132843
* Implement caching of copy assignment operator lookup.Alexis Hunt2011-06-101-187/+82
| | | | | | | | | | | | | I believe, upon, careful review, that this code causes us to incorrectly handle exception specifications of copy assignment operators in C++03 mode. However, we currently do not seem to properly implement the subtle distinction between copying of members and bases made by implicit copy constructors and assignment operators in C++03 - namely that they are limited in their overload selection - in all cases. As such, I feel that committing this code is correct pending a careful review of our implementation of these semantics. llvm-svn: 132841
* Implement caching for copy constructors in similar situations.Alexis Hunt2011-06-101-89/+41
| | | | llvm-svn: 132835
* Implement caching of default constructors on the resolution table. ThisAlexis Hunt2011-06-101-63/+41
| | | | | | | | isn't yet used for the less controlled environments of initialization. Also a few random text fixups. llvm-svn: 132833
* Remove all references to InitializationSequence::FailedSequence from outside ↵Sebastian Redl2011-06-051-6/+6
| | | | | | SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change. llvm-svn: 132664
* Implement a new warning for when adding a default argument to a methodAlexis Hunt2011-05-261-0/+9
| | | | | | | | | makes it into a special member function. This is very bad and can lead to all sorts of nastiness including implicit member functions violating the One Definition Rule. This should probably be made ill-formed in a later version of the standard, but for now we'll just warn. llvm-svn: 132104
* Update our diagnostics to properly account for move operations.Alexis Hunt2011-05-251-8/+18
| | | | llvm-svn: 132096
* Implement a little bit of cleanup and a lot more of the base workAlexis Hunt2011-05-251-9/+6
| | | | | | | | behind implicit moves. We now correctly identify move constructors and assignment operators and update bits on the record correctly. Generation of implicit moves (declarations or definitions) is not yet supported. llvm-svn: 132080
* Implement explicit specialization of explicitly-defaulted constructors.Alexis Hunt2011-05-231-6/+15
| | | | | | | | The general out-of-line case (including explicit instantiation mostly works except that the definition is being lost somewhere between the AST and CodeGen, so the definition is never emitted. llvm-svn: 131933
* Correctly propagate defaultedness across template instantiation. ThisAlexis Hunt2011-05-231-1/+8
| | | | | | | | fixes PR9965, but we're not out of the water yet, as we do not successfully handle out-of-line definitions, due to my utter misunderstanding of how we manage templates. llvm-svn: 131920
* Emulate a MSVC bug where if during an using declaration name lookup, the ↵Francois Pichet2011-05-231-0/+1
| | | | | | | | | | | | | | | declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated. Example: class A { public: int f(); }; class B : public A { private: using A::f; }; class C : public B { private: using B::f; }; Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it. This fixes 1 error when parsing MFC code with clang. llvm-svn: 131896
* Add a missing case for default constructor deletion.Alexis Hunt2011-05-201-0/+5
| | | | | | | This case is tested by the fact that the modified test produces significatly worse diagnostics. That's on the list. llvm-svn: 131759
* Downgrade the error about re-opening an inline namespace as non-inlineDouglas Gregor2011-05-201-3/+11
| | | | | | | to a warning, since apparently libstdc++'s debug mode does this (and we can recover safely). Add a Fix-It to insert the "inline", just for kicks. llvm-svn: 131732
* Reapply r121528, fixing PR9941 by delaying the exception specification check ↵Sebastian Redl2011-05-191-6/+35
| | | | | | for destructors until the class is complete and destructors have been adjusted. llvm-svn: 131632
* After consultation with doug, revert r131515.Alexis Hunt2011-05-181-9/+1
| | | | llvm-svn: 131574
* Revert r121528 as it breaks a simple testcase, which leads to, amongAlexis Hunt2011-05-181-35/+6
| | | | | | other things, libcxx not building. llvm-svn: 131573
* Implement implicit exception specifications of destructors.Sebastian Redl2011-05-181-6/+35
| | | | llvm-svn: 131528
* Implement an additional fix for infinite recursion of deleted specialAlexis Hunt2011-05-181-58/+49
| | | | | | | | | | | | | | | | member functions by making sure that they're on the record before checking for deletion. Also make sure source locations are valid to avoid crashes. Unfortunately, the declare-all-implicit-members approach is still required in order to ensure that dependency loops do not result in incorrectly deleting functions (since they are to be deleted at the declaration point per the standard). Fixes PR9917 llvm-svn: 131520
* Force declaration of implicit members in C++0x mode.Alexis Hunt2011-05-181-1/+9
| | | | | | | | | | | | I hear at least one person crying out in anguish, but it's unfortunately necessary to avoid infinite loops with mutually dependent constructors trying to call each other and determine if they are deleted. It might be possible to go back to the old behavior if we can implement part-of-file lookups efficiently, or if a solution is discovered by which we can safely detect and avoid infinite recusion. llvm-svn: 131515
* Fix some minor bugs and add a lot more test cases for defaultedAlexis Hunt2011-05-171-8/+12
| | | | | | | constructors, including two more FIXMEs (one of which I don't actually understand). llvm-svn: 131487
* Implement some tests for defaulted constructors. To do this I had toAlexis Hunt2011-05-171-17/+19
| | | | | | suppress an error we were previously emitting on valid union code. llvm-svn: 131440
OpenPOWER on IntegriCloud