summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX
AgeCommit message (Collapse)Author
2017-12-21Re-commit r321223, which adds a printing policy to the ASTDumper.Aaron Ballman
This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman
Misc/ast-dump-color.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321229 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20Add a printing policy to the ASTDumper.Aaron Ballman
This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07[ObjC++] Don't warn about pessimizing move for __block variablesAlex Lorenz
rdar://33316951 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317620 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-30Typo correct the condition of 'do-while' before exiting its scopeAlex Lorenz
rdar://35172419 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24[Sema][ObjC] Look for either objc_bridge or objc_bridge_mutable whenAkira Hatanaka
determining whether a RecordDecl is CFError. CFErrorRef used to be declared with "objc_bridge(NSError)" but is now declared with "objc_bridge_mutable(NSError)". Look for either when checking whether a RecordDecl is CFError. rdar://problem/35034779 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316531 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-23[Sema] Add support for flexible array members in Obj-C.Volodymyr Sapsai
Allow Obj-C ivars with incomplete array type but only as the last ivar. Also add a requirement for ivars that contain a flexible array member to be at the end of class too. It is possible to add in a subclass another ivar at the end but we'll emit a warning in this case. Also we'll emit a warning if a variable sized ivar is declared in class extension or in implementation because subclasses won't know they should avoid adding new ivars. In ARC incomplete array objects are treated as __unsafe_unretained so require them to be marked as such. Prohibit synthesizing ivars with flexible array members because order of synthesized ivars is not obvious and tricky to control. Spelling out ivar explicitly gives control to developers and helps to avoid surprises with unexpected ivar ordering. For C and C++ changed diagnostic to tell explicitly a field is not the last one and point to the next field. It is not as useful as in Obj-C but it is an improvement and it is consistent with Obj-C. For C for unions emit more specific err_flexible_array_union instead of generic err_field_incomplete. rdar://problem/21054495 Reviewers: rjmccall, theraven Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38773 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-28[Sema] Put nullability fix-it after the end of the pointer.Volodymyr Sapsai
Fixes nullability fix-it for `id<SomeProtocol>`. With this change nullability specifier is inserted after ">" instead of between "id" and "<". rdar://problem/34260995 Reviewers: jordan_rose, doug.gregor, ahatanak, arphaman Reviewed By: jordan_rose Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38327 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22Add test cases that weren't committed in r313945.Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313952 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Revert "Add support for attribute 'noescape'."Akira Hatanaka
This reverts commit r313722. It looks like compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc cannot be compiled because some of the functions declared in the file do not match the ones in the SDK headers (which are annotated with 'noescape'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Add support for attribute 'noescape'.Akira Hatanaka
The attribute informs the compiler that the annotated pointer parameter of a function cannot escape and enables IRGen to attach attribute 'nocapture' to parameters that are annotated with the attribute. That is the only optimization that currently takes advantage of 'noescape', but there are other optimizations that will be added later that improves IRGen for ObjC blocks. rdar://problem/19886775 Differential Revision: https://reviews.llvm.org/D32210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Revert "Add support for attribute 'noescape'."Akira Hatanaka
This reverts r313717. I closed the wrong phabricator review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313721 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20Add support for attribute 'noescape'.Akira Hatanaka
The attribute informs the compiler that the annotated pointer parameter of a function cannot escape and enables IRGen to attach attribute 'nocapture' to parameters that are annotated with the attribute. That is the only optimization that currently takes advantage of 'noescape', but there are other optimizations that will be added later that improves IRGen for ObjC blocks. rdar://problem/19886775 Differential Revision: https://reviews.llvm.org/D32520 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15[Sema] Correct typos in LHS, RHS before building a binop expression.Volodymyr Sapsai
Specifically, typo correction should be done before dispatching between different kinds of binary operations like pseudo-object assignment, overloaded binary operation, etc. Without this change we hit an assertion Assertion failed: (!LHSExpr->hasPlaceholderType(BuiltinType::PseudoObject)), function CheckAssignmentOperands when in Objective-C we reference a property without `self` and there are 2 equally good typo correction candidates: ivar and a class name. In this case LHS expression in `BuildBinOp` is CXXDependentScopeMemberExpr `-TypoExpr and instead of handling Obj-C property assignment as pseudo-object assignment, we call `CreateBuiltinBinOp` which corrects typo to ObjCPropertyRefExpr '<pseudo-object type>' but cannot handle pseudo-objects and asserts about it (indirectly, through `CheckAssignmentOperands`). rdar://problem/33102722 Reviewers: rsmith, ahatanak, majnemer Reviewed By: ahatanak Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37322 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313323 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10Fix errored return value in CheckFunctionReturnType and add a fixit hintErich Keane
As discovered by ChenWJ and listed on cfe-dev, the error for Objective C return type ended up being wrong. This fixes that. Additionally, as a "while we're there", the other usages of this error and the usage of the FP above both use a FixItHint, so I'll add it here. Differential Revision: https://reviews.llvm.org/D32759 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302720 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10[Sema] Objective-C++ support for type trait __is_base_ofErik Pilkington
rdar://24308607 Differential revision: https://reviews.llvm.org/D32891 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302695 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03Reusing an existing attribute diagnosticOren Ben Simhon
In a previous patch, a new generic error diagnostic for inconsistent attributes was added. In this commit I reuse this diagnostic for ns_returns_retained attribute check. Differential Revision: https://reviews.llvm.org/D32697 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302024 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20Sema: protect against ObjC++ typo-correction failureSaleem Abdulrasool
ObjC++ has two different types of "pointer" types (ObjCClassPointerType and PointerType). Both can be indirected through. However, the former is not a member expression. Ensure that we do not try to rebuild the MRE in that case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300909 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11[Sema][ObjC] Check whether a variable has a definition, rather thanAkira Hatanaka
checking its storage class, when determining whether casting a C pointer to an ObjC pointer is allowed. This change allows casting variables whose declarations are directly contained in a linkage specification to an ObjC pointer type. Those variables are treated as if they contain the extern specifier for the purpose of determining whether they are definitions or not. rdar://problem/29249853 Differential Revision: https://reviews.llvm.org/D31673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299992 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06[ObjC++] Conversions from specialized to non-specialized Objective-C genericAlex Lorenz
object types should be preferred over conversions to other object pointers This change ensures that Clang will select the correct overload for the following code sample: void overload(Base *b); void overload(Derived *d); void test(Base<Base *> b) { overload(b); // Select overload(Base *), not overload(Derived *) } rdar://20124827 Differential Revision: https://reviews.llvm.org/D31597 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[ARC][ObjC++] Use ObjC semantic rules for comparisons between a pointer andAlex Lorenz
an ObjC object pointer When ARC is enabled in Objective-C++, comparisons between a pointer and Objective-C object pointer typically result in errors like this: "invalid operands to a binary expression". This error message can be quite confusing as it doesn't provide a solution to the problem, unlike the non-C++ diagnostic: "implicit conversion of Objective-C pointer type 'id' to C pointer type 'void *' requires a bridged cast" (it also provides fix-its). This commit forces comparisons between pointers and Objective-C object pointers in ARC to use the Objective-C semantic rules to ensure that a better diagnostic is reported. rdar://31103857 Differential Revision: https://reviews.llvm.org/D31177 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299080 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29[Objective-C] Miscellaneous -fobjc-weak FixesBrian Kelley
Summary: After examining the remaining uses of LangOptions.ObjCAutoRefCount, found a some additional places to also check for ObjCWeak not covered by previous test cases. Added a test file to verify all the code paths that were changed. Reviewers: rsmith, doug.gregor, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31007 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29[Objective-C] Fix "weak-unavailable" warning with -fobjc-weakBrian Kelley
Summary: clang should produce the same errors Objective-C classes that cannot be assigned to weak pointers under both -fobjc-arc and -fobjc-weak. Check for ObjCWeak along with ObjCAutoRefCount when analyzing pointer conversions. Add an -fobjc-weak pass to the existing arc-unavailable-for-weakref test cases to verify the behavior is the same. Reviewers: rsmith, doug.gregor, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31006 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29[Objective-C] Fix __weak type traits with -fobjc-weakBrian Kelley
Summary: Similar to ARC, in ObjCWeak Objective-C object pointers qualified with a weak lifetime are not POD or trivial types. Update the type trait code to reflect this. Copy and adapt the arc-type-traits.mm test case to verify correctness. Reviewers: rsmith, doug.gregor, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31004 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299010 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10Print nested name specifiers for typedefs and type aliasesAlex Lorenz
Printing typedefs or type aliases using clang_getTypeSpelling() is missing the namespace they are defined in. This is in contrast to other types that always yield the full typename including namespaces. Patch by Michael Reiher! Differential Revision: https://reviews.llvm.org/D29944 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01[Sema] Add variable captured by a block to the enclosing lambda'sAkira Hatanaka
potential capture list. Fix Sema::getCurLambda() to return the innermost lambda scope when there is a block enclosed in the lambda. Previously, the method would return a nullptr in such cases, which would prevent a variable captured by the enclosed block to be added to the lambda scope's potential capture list. rdar://problem/28412462 Differential Revision: https://reviews.llvm.org/D25556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296584 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-15[Sema] Disallow returning a __block variable via a move.Akira Hatanaka
r274291 made changes to prefer calling a move constructor to calling a copy constructor when returning from a function. This caused programs to crash when a __block variable in the heap was moved out and used later. This commit fixes the bug by disallowing moving out of __block variables implicitly. rdar://problem/28181080 Differential Revision: https://reviews.llvm.org/D29908 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13[test] Make Lit tests C++11 Compatible - Objective-C++Charles Li
Set 5 Objective-C++ tests to run at gnu++98 Differential Revision: https://reviews.llvm.org/D29739 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-03[Sema][ObjC++] Typo correction should handle ivars and propertiesAlex Lorenz
After r260016 and r260017 disabled typo correction for ivars and properties clang didn't report errors about unresolved identifier in the base of ivar and property ref expressions. This meant that clang invoked CodeGen on invalid AST which then caused a crash. This commit re-enables typo correction for ivars and properites, and fixes the PR25113 & PR26486 (that were originally fixed in r260017 and r260016) in a different manner by transforming the Objective-C ivar reference expression with 'IsFreeIvar' preserved. rdar://30310772 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19Add fix-it notes to the nullability consistency warning.Jordan Rose
This is especially important for arrays, since no one knows the proper syntax for putting qualifiers in arrays. nullability.h:3:26: warning: array parameter is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) void arrayParameter(int x[]); ^ nullability.h:3:26: note: insert '_Nullable' if the array parameter may be null void arrayParameter(int x[]); ^ _Nullable nullability.h:3:26: note: insert '_Nonnull' if the array parameter should never be null void arrayParameter(int x[]); ^ _Nonnull rdar://problem/29524992 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290132 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-07[ObjC++] Don't enter a C++ declarator scope when the current context isAlex Lorenz
an Objective-C declaration This commit ensures that Sema won't enter a C++ declarator scope when the current context is an Objective-C declaration. This prevents an assertion failure in EnterDeclaratorContext that's used to ensure that current context will be restored correctly after exiting the declarator context. rdar://20560175 Differential Revision: https://reviews.llvm.org/D26922 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Don't require nullability on 'va_list'.Jordan Rose
There are many non-portable typedefs, but va_list is one that nobody ever thinks of as a pointer or an array. (When's the last time you saw someone check for a NULL va_list?) Make an exception for this one special type. Part of rdar://problem/25846421. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Warn when 'assume_nonnull' infers nullability within an array.Jordan Rose
...or within a reference. Both of these add an extra level of indirection that make us less certain that the pointer really was supposed to be non-nullable. However, changing the default behavior would be a breaking change, so we'll just make it a warning instead. Part of rdar://problem/25846421 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10Add -Wnullability-completeness-on-arrays.Jordan Rose
This is an addition to (and sub-warning of) -Wnullability-completeness that warns when an array parameter is missing nullability. When the specific warning is switched off, the compiler falls back to only warning on pointer types written as pointer types. Note that use of nullability /within/ an array triggers the completeness checks regardless of whether or not the array-specific warning is enabled; the intent there is simply to determine whether a particular header is trying to be nullability-aware at all. Part of rdar://problem/25846421. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02Don't require nullability on template parameters in typedefs.Jordan Rose
Previously the following code would warn on the use of "T": template <typename T> struct X { typedef T *type; }; ...because nullability is /allowed/ on template parameters (because they could be pointers). (Actually putting nullability on this use of 'T' will of course break if the argument is a non-pointer type.) This fix doesn't handle the case where a template parameter is used /outside/ of a typedef. That seems trickier, especially in parameter position. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith
This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. This is a re-commit of r284800. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21Revert "DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' ↵Renato Golin
rules." This reverts commit r284800, as it failed all ARM/AArch64 bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21DR583, DR1512: Implement a rewrite to C++'s 'composite pointer type' rules.Richard Smith
This has two significant effects: 1) Direct relational comparisons between null pointer constants (0 and nullopt) and pointers are now ill-formed. This was always the case for C, and it appears that C++ only ever permitted by accident. For instance, cases like nullptr < &a are now rejected. 2) Comparisons and conditional operators between differently-cv-qualified pointer types now work, and produce a composite type that both source pointer types can convert to (when possible). For instance, comparison between 'int **' and 'const int **' is now valid, and uses an intermediate type of 'const int *const *'. Clang previously supported #2 as an extension. We do not accept the cases in #1 as an extension. I've tested a fair amount of code to check that this doesn't break it, but if it turns out that someone is relying on this, we can easily add it back as an extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15Sema: support __declspec(dll*) on ObjC interfacesSaleem Abdulrasool
Extend the __declspec(dll*) attribute to cover ObjC interfaces. This was requested by Microsoft for their ObjC support. Cover both import and export. This only adds the semantic analysis portion of the support, code-generation still remains outstanding. Add some basic initial documentation on the attributes that were previously empty. Tweak the previous tests to use the relative expected-warnings to make the tests easier to read. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23Re-commit r273548, reverted in r273589, with a fix to not produceRichard Smith
-Wfor-loop-analysis warnings for a for-loop with a condition variable. In such a case, the loop condition variable is modified on each iteration of the loop by definition. Original commit message: Rearrange condition handling so that semantic checks on a condition variable are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23Revert r273548, "Rearrange condition handling so that semantic checks on a ↵Peter Collingbourne
condition variable" as it caused a regression in -Wfor-loop-analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23Rearrange condition handling so that semantic checks on a condition variableRichard Smith
are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03Obj-C: Fix assert-on-invalid (PR27822)Hans Wennborg
Clang would assert when isObjCInstancetype() was called on a tok::annot_cxxscope token. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-04[ObjC] Enter a new evaluation context before callingAkira Hatanaka
BuildBlockForLambdaConversion. Previously, clang would build an incorrect AST for the following code: id test() { return @{@"a": [](){}, @"b": [](){}}; } ReturnStmt 0x10d080448 `-ExprWithCleanups 0x10d080428 |-cleanup Block 0x10d0801f0 // points to the second BlockDecl ... -BlockDecl 0x10d07f150 // First block ... -BlockDecl 0x10d0801f0 // Second block ... `-ExprWithCleanups 0x10d0801d0 |-cleanup Block 0x10d07f150 // points to the first BlockDecl To fix the bug, this commit enters a new evaluation context to reset ExprNeedsCleanups before each block is parsed. rdar://problem/16879958 Differential Revision: http://reviews.llvm.org/D18815 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25[ObjCXX] Warn undeclared identifiers.Manman Ren
Instantiation dependence were not being handled correctly for OpqaueValueExpr AST nodes. As a result, if an undeclared identifier was used in a CXXNewExpr that is assigned to a ObjC property, there would be no error during parsing, and there would be a crash during code gen. This patch makes sure that an error will be issued during parsing in this case. Before the fix, if CXXNewExpr has a typo, its InstantiationDependent will be set to true, but if it is wrapped in a OpaqueValueExpr, the OpaqueValueExpr will not be instantiation dependent, causing the TypoExpr not be to resolved. The fix propagates InstantiationDependent to OpaqueValueExpr from its SourceExpr. It also propagates the other instantiation bits. rdar://24975562 Differential Revision: http://reviews.llvm.org/D18461 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03Improve some infrastructure for extended parameter infos andJohn McCall
fix a bug with the instantiation of ns_consumed parameter attributes in ARC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01Test template instantiation of ns_consumed and ns_returns_retained.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25[Sema] Remove assert in TreeTransform<Derived>::TransformObjCObjectType.Akira Hatanaka
The assert isn't correct since TypeLoc::ObjCObjectTypeLoc doesn't indicate whether the type is a dependent type. The function returns false for a type like "<SomeProtocol>" which is a synonym for "id<SomeProtocol>". rdar://problem/23838912 Differential Revision: http://reviews.llvm.org/D17355 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18[Sema] Fix bug in TypeLocBuilder::pushImplAkira Hatanaka
The code in TypeLocBuilder::pushImpl wasn't correctly handling the case where an element that has an 8-byte alignment was being pushed. I plan to follow up with a patch to remove redundancies and simplify the function. rdar://problem/23838912 Differential Revision: http://reviews.llvm.org/D16843 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02ObjCXX: fix a crash during typo correction.Manman Ren
For ObjCXX, we can create a CastExpr with Kind being CK_UserDefinedConversion and SubExpr being BlockExpr. Specifically one can return BlockExpr from BuildCXXMemberCallExpr and the result can be used to build a CastExpr. Fix the assumption in CastExpr::getSubExprAsWritten that SubExpr can only be CXXMemberCallExpr. rdar://problem/24364077 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259591 91177308-0d34-0410-b5e6-96231b3b80d8