summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add 178663 back.Rafael Espindola2013-04-031-12/+8
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-8/+12
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-12/+8
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* If a defaulted special member is implicitly deleted, check whether it'sRichard Smith2013-04-021-7/+30
| | | | | | | overriding a non-deleted virtual function. The existing check for this doesn't catch this case, because it fires before we mark the method as deleted. llvm-svn: 178563
* PR15597: Fix a confusion between the implicit exception specification and theRichard Smith2013-03-271-2/+11
| | | | | | | | uninstantiated exception specification when a special member within a class template is both defaulted and given an exception specification on its first declaration. llvm-svn: 178103
* <rdar://problem/13267210> Ensure that Sema::CompareReferenceRelationship ↵Douglas Gregor2013-03-261-14/+10
| | | | | | | | | | | | | returns consistent results with invalid types. When Sema::RequireCompleteType() is given a class template specialization type that then fails to instantiate, it returns 'true'. On subsequent invocations, it can return false. Make sure that this difference doesn't change the result of Sema::CompareReferenceRelationship, which is expected to remain stable while we're checking an initialization sequence. llvm-svn: 178088
* <rdar://problem/13185264> Don't crash when attempting to redundantly ↵Douglas Gregor2013-03-251-1/+1
| | | | | | initialize a member of an anonymous union. llvm-svn: 177941
* Fix a crash-on-valid where a block capture copy expression wasJohn McCall2013-03-221-0/+3
| | | | | | | | | | | | picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. llvm-svn: 177692
* Remove some dead code.John McCall2013-03-201-11/+0
| | | | | | Patch by Stephen Lin! llvm-svn: 177490
* Bring inheriting constructor implementation up-to-date with current defectRichard Smith2013-03-181-79/+168
| | | | | | | | | reports, and implement implicit definition of inheriting constructors. Remaining missing features: inheriting constructor templates, implicit exception specifications for inheriting constructors, inheriting constructors from dependent bases. llvm-svn: 177320
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-17/+30
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Add a hasExternalLinkage helper. No functionality change.Rafael Espindola2013-03-071-1/+1
| | | | llvm-svn: 176607
* PR15390: If a function returns a pointer to a function, that function typeRichard Smith2013-03-061-1/+12
| | | | | | | can't have default arguments even though it's a parameter-declaration-clause in a function declaration. llvm-svn: 176542
* Silence a number of static analyzer warnings with assertions and such.Jordan Rose2013-03-051-3/+4
| | | | | | No functionality change. llvm-svn: 176469
* [Sema] Semantic analysis for empty-declaration and attribute-declaration.Michael Han2013-02-221-17/+11
| | | | | | | | Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these attributes can be sema checked just as attributes attached to "normal" declarations. llvm-svn: 175900
* Process and handle attributes on conditions and for loop variables. Process andRichard Smith2013-02-201-1/+25
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-191-0/+17
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-10/+11
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* Make helper functions static.Benjamin Kramer2013-02-151-1/+1
| | | | llvm-svn: 175265
* Don't check whether a friend declaration is correctly formed when instantiating,Nick Lewycky2013-02-061-33/+35
| | | | | | we already checked it when parsing. llvm-svn: 174486
* Add some missing diagnostics for C++11 narrowing conversions.Richard Smith2013-02-051-2/+4
| | | | llvm-svn: 174337
* Don't do delayed exception-specification checking on an invalidDouglas Gregor2013-02-011-0/+8
| | | | | | class. Fixes <rdar://problem/13017229>. llvm-svn: 174145
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-311-3/+4
| | | | llvm-svn: 174050
* Fix unused variable warnings in -asserts buildMatt Beaumont-Gay2013-01-311-2/+2
| | | | llvm-svn: 173996
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-301-1/+30
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-251-1/+1
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* Remove windows line endings.David Blaikie2013-01-181-6/+6
| | | | llvm-svn: 172865
* Improve -Wreorder to handle cases of anonymous class member orderingDavid Blaikie2013-01-171-26/+11
| | | | llvm-svn: 172707
* ArrayRef-ize some ctor initializer related APIsDavid Blaikie2013-01-171-31/+23
| | | | llvm-svn: 172701
* Remove some unnecessary castsDavid Blaikie2013-01-171-4/+4
| | | | llvm-svn: 172700
* Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn onRichard Smith2013-01-171-1/+1
| | | | | | | expressions which have undefined behavior due to multiple unsequenced modifications or an unsequenced modification and use of a variable. llvm-svn: 172690
* Fixes crash when illegal function definitions are deleted or defaulted. ↵Aaron Ballman2013-01-161-2/+2
| | | | | | Fixes PR14577. llvm-svn: 172676
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-141-21/+13
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* ArrayRef'ize Sema APIs related to format string checkingDmitri Gribenko2013-01-131-1/+3
| | | | llvm-svn: 172367
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-4/+4
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-081-4/+4
| | | | llvm-svn: 171894
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-19/+19
| | | | llvm-svn: 171367
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-291-2/+2
| | | | llvm-svn: 171238
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-191-44/+14
| | | | | | | | | | | | copy-list-initialization (and doesn't add an additional copy step): Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it when instantiating initializers in order to correctly handle instantiation of copy-list-initialization. Teach TreeTransform that function arguments are initializations, and so need this special treatment too. Finally, remove some hacks which were working around SubstInitializer's shortcomings. llvm-svn: 170489
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-191-21/+22
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* PR14558: Compute triviality of special members (etc) at the end of the classRichard Smith2012-12-111-85/+109
| | | | | | | | | definition, rather than at the end of the definition of the set of nested classes. We still defer checking of the user-specified exception specification to the end of the nesting -- we can't check that until we've parsed the in-class initializers for non-static data members. llvm-svn: 169805
* Virtual method overrides can no longer have mismatched calling conventions. ↵Aaron Ballman2012-12-091-0/+35
| | | | | | This fixes PR14339. llvm-svn: 169705
* PR14550: If a system header contains a bogus constexpr function definition,Richard Smith2012-12-091-2/+3
| | | | | | don't mark the function as invalid, since we suppress the error. llvm-svn: 169689
* Finish implementing 'selected constructor' rules for triviality in C++11. InRichard Smith2012-12-081-49/+81
| | | | | | | | | | | | | | | | | | | | | | | | the cases where we can't determine whether special members would be trivial while building the class, we eagerly declare those special members. The impact of this is bounded, since it does not trigger implicit declarations of special members in classes which merely *use* those classes. In order to determine whether we need to apply this rule, we also need to eagerly declare move operations and destructors in cases where they might be deleted. If a move operation were supposed to be deleted, it would instead be suppressed, and we could need overload resolution to determine if we fall back to a trivial copy operation. If a destructor were implicitly deleted, it would cause the move constructor of any derived classes to be suppressed. As discussed on cxx-abi-dev, C++11's selected constructor rules are also retroactively applied as a defect resolution in C++03 mode, in order to identify that class B has a non-trivial copy constructor (since it calls A's constructor template, not A's copy constructor): struct A { template<typename T> A(T &); }; struct B { mutable A a; }; llvm-svn: 169673
* Remove some remnants of the assumption that there is at most one of eachRichard Smith2012-12-081-2/+18
| | | | | | flavour of special member. llvm-svn: 169670
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-081-104/+478
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Per [dcl.fct.def.default]p1, don't allow variadic special members to be ↵Richard Smith2012-12-071-0/+4
| | | | | | defaulted. llvm-svn: 169574
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-9/+9
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Consistently use 'needsImplicit<special member>' to determine whether we needRichard Smith2012-12-011-5/+9
| | | | | | | an implicit special member, rather than sometimes using '!hasDeclared<special member>'. No functionality change. llvm-svn: 169075
* The declaration of a special member can require overload resolution to beRichard Smith2012-11-291-0/+54
| | | | | | | | | | | performed, to determine whether that special member is deleted or constexpr. That overload resolution process can in turn trigger the instantiation of a template, which can do anything, including triggering the declaration of that very same special member function. When this happens, do not try to recursively declare the special member -- that's impossible. Instead, only try to realise the truth. There is no special member. llvm-svn: 168847
OpenPOWER on IntegriCloud