summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* C++1y: support simple variable assignments in constexpr functions.Richard Smith2013-04-261-5/+6
| | | | llvm-svn: 180603
* Add r180263 back, but fix hasBraces() to be correct during parsing.Rafael Espindola2013-04-261-1/+2
| | | | | | | | Original commit message: Fix a case in linkage computation that should check for single line extern "C". llvm-svn: 180591
* Put friend decls in the correct context.Rafael Espindola2013-04-251-15/+25
| | | | | | | | | | When we find a friend declaration we have to skip transparent contexts for doing lookups, but we should not skip them when inserting the new decl if the lookup found nothing. Fixes PR15841. llvm-svn: 180571
* C++1y constexpr extensions, round 1: Allow most forms of declaration andRichard Smith2013-04-221-48/+200
| | | | | | | | statement in constexpr functions. Everything which doesn't require variable mutation is also allowed as an extension in C++11. 'void' becomes a literal type to support constexpr functions which return 'void'. llvm-svn: 180022
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-201-3/+5
| | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. llvm-svn: 179958
* PR15755: don't drop parameter packs when dropping parameters with defaultRichard Smith2013-04-171-7/+10
| | | | | | arguments in the formation of a candidate set of inheriting constructors. llvm-svn: 179708
* Sema: Remove unused variable.Benjamin Kramer2013-04-171-4/+0
| | | | llvm-svn: 179701
* DR974: Lambdas can have default arguments.Richard Smith2013-04-171-12/+2
| | | | llvm-svn: 179688
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-2/+108
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Parsing support for thread_local and _Thread_local. We give them the sameRichard Smith2013-04-121-22/+16
| | | | | | semantics as __thread for now. llvm-svn: 179424
* Add support for computing the exception specification for an inheritingRichard Smith2013-04-101-4/+69
| | | | | | | | | | | constructor. This isn't quite perfect (as usual, we don't handle default arguments correctly yet, and we don't deal with copy/move constructors for arguments correctly either, but this will be fixed when we implement core issue 1351. This completes our support for inheriting constructors. llvm-svn: 179154
* C++11 inheriting constructors: support for inheriting constructor templates.Richard Smith2013-04-101-192/+288
| | | | llvm-svn: 179151
* When checking for illegal expressions in a default-argumentJohn McCall2013-04-091-0/+18
| | | | | | | | expression, look through pseudo-object expressions. rdar://13602832 llvm-svn: 179080
* When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to addRichard Trieu2013-04-051-1/+3
| | | | | | | more information to the notes. This information is already present on other diagnostic messages that involves overloads. llvm-svn: 178923
* 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
OpenPOWER on IntegriCloud