summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | llvm-svn: 140478
* Correctly parse braced member initializers (even in delayed parsing) and ↵Sebastian Redl2011-09-241-103/+97
| | | | | | | | | | | correctly pass the information on to Sema. There's still an incorrectness in the way template instantiation works now, but that is due to a far larger underlying representational problem. Also add a test case for various list initialization cases of scalars, which test this commit as well as the previous one. llvm-svn: 140460
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* When checking for weak vtables, check whether the actual definition ofDouglas Gregor2011-09-231-1/+4
| | | | | | | | the key function is inline, rather than the original declaration. Perhaps FunctionDecl::isInlined() is poorly named. Fixes <rdar://problem/9979458>. llvm-svn: 140400
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Don't finalize checking of base and member initializers for aDouglas Gregor2011-09-221-1/+1
| | | | | | constructor template. Fixes PR10457. llvm-svn: 140350
* Only trigger the initialize-an-array-via-elementwise-copy/move codeDouglas Gregor2011-09-221-2/+3
| | | | | | | | generation when we're dealing with an implicitly-defined copy or move constructor. And, actually set the implicitly-defined bit for implicitly-defined constructors and destructors. Should fix self-host. llvm-svn: 140334
* ArrayRef-ifying the fields passed to Sema::ActOnFieldsDavid Blaikie2011-09-221-2/+2
| | | | llvm-svn: 140293
* ArrayRef-ifying Function/BlockDecl's setParamsDavid Blaikie2011-09-211-5/+5
| | | | llvm-svn: 140268
* Diagnose attempts to write a templated data member, from StepanDouglas Gregor2011-09-211-3/+25
| | | | | | Dyatkovskiy! Fixes PR10896. llvm-svn: 140250
* Fix a pretty nasty bug in noreturn destructors that cascaded into lotsChandler Carruth2011-09-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | of false positive warnings that depend on noreturn destructors pruning the CFGs, but only in C++0x mode! This was really surprising as the debugger quickly reveals that the attributes are parsed correctly (and using the same code) in both modes. The warning fires in the same way in both modes. But between parsing and building the destructor declaration with the noreturn attribute and the warning, it magically disappears. The key? The 'noexcept' appears! When we were rebuilding the destructor type with the computed implicit noexcept we completely dropped the old type on the floor. This almost makes sense (as the arguments and return type to a destructor aren't exactly unpredictable), but lost any function type attributes as well. The fix is simple, we build the new type off of the old one rather than starting fresh. Testing this is a bit awkward. I've done it by running the noreturn-sensitive tests in both modes, which previous failed and now passes, but if anyone has ideas about how to more specifically and thoroughly test that the extended info on a destructor is preserved when adding noexcept, I'm all ears. llvm-svn: 140138
* Removed an unused field and its accessors methods.Erik Verbruggen2011-09-191-1/+0
| | | | llvm-svn: 140017
* In constructors, don't generate implicit initializers for members of ↵Richard Smith2011-09-191-1/+15
| | | | | | anonymous structs contained within anonymous unions. llvm-svn: 140015
* Remove function which is unused as of r139996. Thanks to David Blaikie for ↵Richard Smith2011-09-191-13/+0
| | | | | | bringing this to my attention. llvm-svn: 140013
* PR10304: Do not call destructors for data members from union destructors. ↵Richard Smith2011-09-181-2/+3
| | | | | | | | | Prior to C++11, this has no effect since any such destructors must be trivial, and in C++11 such destructors must not be called. llvm-svn: 139997
* PR10954: variant members should not be implicitly initialized in ↵Richard Smith2011-09-181-11/+5
| | | | | | | | constructors if no mem-initializer is specified for them, unless an in-class initializer is specified. llvm-svn: 139996
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* __module_private__ is inherited by redeclarations of an entity, andDouglas Gregor2011-09-091-1/+1
| | | | | | must also be present of the first declaration of that entity. llvm-svn: 139384
* Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to ↵Richard Trieu2011-09-091-2/+3
| | | | | | CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs. llvm-svn: 139350
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-0/+1
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* Change all references of type ExprTy to Expr and get rid of the typedefs.Richard Trieu2011-09-091-3/+3
| | | | llvm-svn: 139347
* When performing a derived-to-base cast on the right-hand side of theDouglas Gregor2011-09-061-1/+1
| | | | | | | | | | | | | | | | synthesized move assignment within an implicitly-defined move assignment operator, be sure to treat the derived-to-base cast as an xvalue (rather than an lvalue). Otherwise, we'll end up getting the wrong constructor. Optimize a direct call to a trivial move assignment operator to an aggregate copy, as we do for trivial copy assignment operators, and update the the assertion in CodeGenFunction::EmitAggregateCopy() to cope with this optimization. Fixes PR10860. llvm-svn: 139143
* Add test case for defaulted copy and move structure validation.Sebastian Redl2011-09-041-14/+13
| | | | | | | | Fix bug this uncovered. Address minor comments from Doug. Enable cxx_implicit_moves feature. llvm-svn: 139101
* Teach -Wdangling-field to warn about temporaries bound to references asChandler Carruth2011-09-031-9/+17
| | | | | | | | | | | | | well. Also, clean up the flow of the code a bit, and factor things more nicely. Finally, add the test case that was missing from my previous commit (sorry), with new tests added to cover temporaries and other fun cases. llvm-svn: 139077
* Add a simple new warning to catch blatantly dangling pointer andChandler Carruth2011-09-031-2/+51
| | | | | | | | | | | | | | | | | reference members of classes. We've had several bugs reported because of this, and there's no reason not to flag it right away in the compiler. Comments especially welcome on the strategy for implementing this warning (IE, what should trigger this?) and on the text of the warning itself. I'm going to extend this to cover obvious cases with temporaries and beef up the test cases some in subsequent patches. I'll then run it over a large codebase and make sure its not misbehaving before I add it to -Wall or turn it on by default. I think this one might be a good candidate for on by default. llvm-svn: 139075
* When defining the implicit move assignment operator, don't performDouglas Gregor2011-09-011-3/+9
| | | | | | | | semantic analysis when taking the address of an xvalue. Instead, just build the unary operator directly, since it's safe to do so (from the IRgen and AST perspectives) for any glvalue. Fixes PR10822. llvm-svn: 138935
* Allow C99 hexfloats in C++0x mode. This change resolves the standardsDouglas Gregor2011-08-301-0/+24
| | | | | | | | | collision between C99 hexfloats and C++0x user-defined literals by giving C99 hexfloats precedence. Also, warning about user-defined literals that conflict with hexfloats and those that have names that are reserved by the implementation. Fixes <rdar://problem/9940194>. llvm-svn: 138839
* Declare and define implicit move constructor and assignment operator.Sebastian Redl2011-08-301-51/+1130
| | | | | | | | | This makes the code duplication of implicit special member handling even worse, but the cleanup will have to come later. For now, this works. Follow-up with tests for explicit defaulting and enabling the __has_feature flag to come. llvm-svn: 138821
* 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
OpenPOWER on IntegriCloud