summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert the linkage fix.Faisal Vali2013-09-292-71/+0
| | | | | | I got a bunch of buildbot failures that i don't understand - sorry. llvm-svn: 191647
* Fix computation of linkage within nested lambdas.Faisal Vali2013-09-292-0/+71
| | | | | | | | | | When nested lambdas are used in NSDMI's - this prevents infinite recursion. See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval regarding the code, and then request for some tests. [On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions] llvm-svn: 191645
* Implement conversion to function pointer for generic lambdas without captures.Faisal Vali2013-09-292-23/+136
| | | | | | | | | | | | | | | | The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization. Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator. This patch has been reviewed in person both by Doug and Richard. Richard gave me the LGTM. A few minor changes: - per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation). - I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively. - Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker. I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming. Thanks! llvm-svn: 191634
* Add character set related __STDC_* definitions.Ed Schouten2013-09-291-0/+14
| | | | | | | | | | | | | Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's exclusively. This means that we can define __STDC_UTF_16__ and __STDC_UTF_32__ unconditionally. While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's wchar_t's don't encode characters as ISO-10646; the encoding depends on the locale used. Because the character set used might not be a superset of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__. llvm-svn: 191631
* Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;Richard Smith2013-09-292-0/+100
| | | | | | | instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out the backward-compatibility issues. llvm-svn: 191629
* The second parameter of nexttoward is always long double.Benjamin Kramer2013-09-281-4/+4
| | | | llvm-svn: 191623
* Separate construction of bi-arch path suffix from construction ofSimon Atanasyan2013-09-281-37/+37
| | | | | | | | | | | | | | multi-library path suffix. The code calculates MIPS toolchain specific multi-lib path suffixes like mips16/soft-float/el is moved to the separate function findMultiLibSuffix(). This function called during GCC installation detection and result is stored for the future using. The patch reviewed by Rafael Espindola. http://llvm-reviews.chandlerc.com/D1738 llvm-svn: 191612
* Add compat/extension warnings for init captures.Richard Smith2013-09-286-11/+20
| | | | llvm-svn: 191609
* Add extra testing for init-captures.Richard Smith2013-09-281-0/+14
| | | | llvm-svn: 191608
* Mark lambda init-captures as complete.Richard Smith2013-09-282-1/+18
| | | | llvm-svn: 191607
* Switch from putting init capture VarDecls in the surrounding DeclContext toRichard Smith2013-09-281-0/+4
| | | | | | | | putting them in the call operator's DeclContext. This better matches the language wording and avoids some cases where code gets confused by them for namespace-scope lambdas and the like. llvm-svn: 191606
* Per latest drafting, switch to implementing init-captures as if by declaringRichard Smith2013-09-286-40/+157
| | | | | | and capturing a variable declaration, and complete the implementation of them. llvm-svn: 191605
* [analyzer] Make inlining decisions based on the callee being variadic.Jordan Rose2013-09-281-1/+26
| | | | | | | | | | | | ...rather than trying to figure it out from the call site, and having people complain that we guessed wrong and that a prototype-less call is the same as a variadic call on their system. More importantly, fix a crash when there's no decl at the call site (though we could have just returned a default value). <rdar://problem/15037033> llvm-svn: 191599
* Don't suggest namespaces if the next token is a '.'Kaelyn Uhrain2013-09-271-0/+7
| | | | llvm-svn: 191589
* TBAA: use the same format for scalar TBAA and struct-path aware TBAA.Manman Ren2013-09-275-13/+23
| | | | | | | Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. llvm-svn: 191586
* ObjectiveC migrator. Infer property from getters onlyFariborz Jahanian2013-09-272-0/+8
| | | | | | | if property name is a valid identifier in the underlying language. // rdar://15044184 llvm-svn: 191584
* Fix a bug where we failed to diagnose class template specializationChandler Carruth2013-09-271-2/+3
| | | | | | | | | uses. This fixes one of the two remaining failures to implement [[deprecated]] as specified for C++14. llvm-svn: 191572
* Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola2013-09-2752-78/+73
| | | | | | | | | disable-objc-default-synthesize-properties. We want the modern behavior most of the time, so inverting the option simplifies the driver and the tests. llvm-svn: 191551
* Implement N3760, support for the [[deprecated]] attribute.Chandler Carruth2013-09-271-0/+29
| | | | | | | | | | | | | | | | | | | This motion appears to have consensus in the C++ committee and is expected to be voted into the C++14 draft tomorrow during the formal vote. No extension warning in C++11 as attributes not specified in the standard using the standard syntax in C++11 have implementation defined meaning, and we define the meaning proposed for C++14. There is one bug exposed as we do not warn on a deprecated template specialization. I've left a FIXME in the test case and will dig into that next. Also, I will add a few more exhaustive test cases of the other features specified for this attribute in a follow-up commit. llvm-svn: 191550
* Mark variable template implementation as complete. Nearly all of the creditRichard Smith2013-09-272-5/+16
| | | | | | here goes to Larisse Voufo. llvm-svn: 191549
* Variable templates: handle instantiation of static data member templatesRichard Smith2013-09-273-68/+162
| | | | | | appropriately, especially when they appear within class templates. llvm-svn: 191548
* Don't give suggest things like function names on the left side of "=".Kaelyn Uhrain2013-09-272-3/+7
| | | | llvm-svn: 191545
* Avoid the hard-coded limit on the number of typo corrections attempted.Kaelyn Uhrain2013-09-272-33/+37
| | | | | | | | | | | | | | | Move some tests from typo-correction.cpp to typo-correction-pt2.cpp because they were running afoul of the hard-coded limit of 20 typos corrected. Some of the tests after it were still working due to the limit not applying to cached corrections and in cases where a non-NULL MemberContext is passed in to Sema::CorrectTypo. Most of the moved tests still passed after being moved, but the test involving "data_struct" had only been passing because the test had exceeded that limit so a fix for it is also included (most of the changes to ParseStmt.cpp are shared with and originated from another typo correction impovement that was split into a separate commit). llvm-svn: 191544
* clang-cl: pass /FI options to fallbackHans Wennborg2013-09-271-1/+2
| | | | | | | We started parsing /FI in r191442, and now we can pass it on to the fallback too. llvm-svn: 191537
* Quick-fix the test for no-asserts buildTimur Iskhodzhanov2013-09-271-2/+2
| | | | llvm-svn: 191534
* Fix the test files by removing the unnecessary -emit-llvm flag (should ↵Faisal Vali2013-09-272-6/+2
| | | | | | address Matt Beaumont-Gay's concern regarding failure on a read-only filesystem) llvm-svn: 191531
* Abstract out the emission of vtables, add basic support for vtable emission ↵Timur Iskhodzhanov2013-09-278-76/+195
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1532 llvm-svn: 191523
* AST: Handle multidimensional arrays inside of __uuidof()David Majnemer2013-09-271-0/+4
| | | | | | | | We previously handled one-dimensional arrays but didn't consider the general case. The fix is simple: keep going through subsequent dimensions until we get to the base element. llvm-svn: 191493
* AST: Handle qualified array types in typeid() expressionsDavid Majnemer2013-09-271-0/+3
| | | | | | | | | | | | The intent of getTypeOperand() was to yield an unqualified type. However QualType::getUnqualifiedType() does not strip away qualifiers on arrays. N.B. This worked fine when typeid() was applied to an expression because we would inject as implicit cast to the unqualified array type in the AST. llvm-svn: 191487
* Add -fno-unsigned-char and ignore it. We already support -fno-signed-char, addNick Lewycky2013-09-271-0/+2
| | | | | | both flags to the driver test. llvm-svn: 191486
* Sema: Respect -fdelayed-template-parsing when parsing constexpr functionsDavid Majnemer2013-09-271-0/+12
| | | | | | | | | | | | | | Functions declared as constexpr must have their parsing delayed in -fdelayed-template-parsing mode so as not to upset later template instantiation. N.B. My reading of the standard makes it seem like delayed template parsing is at odds with constexpr. We may want to make refinements in other places in clang to make constexpr play nicer with this feature. This fixes PR17334. llvm-svn: 191484
* ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTERFariborz Jahanian2013-09-262-0/+4
| | | | | | on class methods, as it makes no sense. // rdar://15069200 llvm-svn: 191468
* ObjectiveC migrator: function pointer is not anFariborz Jahanian2013-09-261-1/+1
| | | | | | | | inner pointer for annotation to objc_returns_inner_pointer purposes. // rdar://15044991 llvm-svn: 191465
* Debug info: Fix a crash when trying to construct a type with redundantAdrian Prantl2013-09-261-0/+23
| | | | | | | ownership qualifiers. Fixes rdar://problem/14990656. llvm-svn: 191463
* Fix error recovery when a return type correction includes a new name specifier.Kaelyn Uhrain2013-09-261-3/+1
| | | | llvm-svn: 191459
* Fix up fallout from r187156.Bob Wilson2013-09-261-1/+3
| | | | | | | | | The previous change caused the driver to translate -Wa,-L to the -msave-temp-labels option for cc1as, but cc1as did not accept that option. This patch follows the same approach used for similar options (-relax-all, -noexecstack) in the previous patch. llvm-svn: 191458
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-09-266-2/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the following features are not included in this commit: - any sort of capturing within generic lambdas - generic lambdas within template functions and nested within other generic lambdas - conversion operator for captureless lambdas - ensuring all visitors are generic lambda aware (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit) As an example of what compiles through this commit: template <class F1, class F2> struct overload : F1, F2 { using F1::operator(); using F2::operator(); overload(F1 f1, F2 f2) : F1(f1), F2(f2) { } }; auto Recursive = [](auto Self, auto h, auto ... rest) { return 1 + Self(Self, rest...); }; auto Base = [](auto Self, auto h) { return 1; }; overload<decltype(Base), decltype(Recursive)> O(Base, Recursive); int num_params = O(O, 5, 3, "abc", 3.14, 'a'); Please see attached tests for more examples. This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics). Some implementation notes: - Add a new Declarator context => LambdaExprParameterContext to clang::Declarator to allow the use of 'auto' in declaring generic lambda parameters - Add various helpers to CXXRecordDecl to facilitate identifying and querying a closure class - LambdaScopeInfo (which maintains the current lambda's Sema state) was augmented to house the current depth of the template being parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth) so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately generate a template-parameter-type when 'auto' is parsed in a generic lambda parameter context. (i.e we do NOT use AutoType deduced to a template parameter type - Richard seemed ok with this approach). We encode that this template type was generated from an auto by simply adding $auto to the name which can be used for better diagnostics if needed. - SemaLambda.h was added to hold some common lambda utility functions (this file is likely to grow ...) - Teach Sema::ActOnStartOfFunctionDef to check whether it is being called to instantiate a generic lambda's call operator, and if so, push an appropriately prepared LambdaScopeInfo object on the stack. - various tests were added - but much more will be needed. There is obviously more work to be done, and both Richard (weakly) and Doug (strongly) have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData in a future patch which is forthcoming. A greatful thanks to all reviewers including Eli Friedman, James Dennett, and especially the two gracious wizards (Richard Smith and Doug Gregor) who spent hours providing feedback (in person in Chicago and on the mailing lists). And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified! Thanks! llvm-svn: 191453
* Fix a bug in the typo correction replacement location.Kaelyn Uhrain2013-09-261-0/+21
| | | | | | | | I noticed the wrong text was being replaced with the correction while working on expanding the "namespace-aware" typo correction to include classes. llvm-svn: 191450
* Teach typo correction to look inside of classes like it does namespaces.Kaelyn Uhrain2013-09-266-21/+82
| | | | | | | | | | | | | | | Unlike with namespaces, searching inside of classes requires also checking the access to correction candidates (i.e. don't suggest a correction to a private class member for a correction occurring outside that class and its methods or friends). Included is a small (one line) fix for a bug, that was uncovered while cleaning up the unit tests, where the decls from a TypoCorrection candidate were preserved in new TypoCorrection candidates that are derived (copied) from the old TypoCorrection--notably when creating a new candidate by changing the NestedNameSpecifier associated with the base idenitifer. llvm-svn: 191449
* Add macro test from N3781.Richard Smith2013-09-261-0/+5
| | | | llvm-svn: 191444
* Per updates to D3781, allow underscore under ' in a pp-number, and allow ' ↵Richard Smith2013-09-261-2/+6
| | | | | | in a #line directive. llvm-svn: 191443
* clang-cl: Add /FI (forced include) as an alias for -includeReid Kleckner2013-09-261-3/+6
| | | | | | Patch by Jeff Muizelaar, with added test case. llvm-svn: 191442
* [driver] Ignore -fno-var-tracking; it's a GCC option we don't support.Jordan Rose2013-09-261-0/+1
| | | | | | | -fvar-tracking (which IIUC is on by default in GCC) will still generate an error. llvm-svn: 191439
* Remove fno_builtin_strcat and fno_builtin_strcpy.Rafael Espindola2013-09-261-1/+2
| | | | | | | They are already handled by the generic fno_bultin_, which also avoids unused warnings. llvm-svn: 191437
* Ignore unknown -fno-builtin-*.Rafael Espindola2013-09-261-0/+1
| | | | | | This matches gcc's behavior. llvm-svn: 191434
* Ignore some -f options that are supported by gcc.Rafael Espindola2013-09-261-0/+23
| | | | | | | It is possible that we should say some of these are unsupported, but this is not any worse than the old behavior of ignoring all unknown -f options. llvm-svn: 191429
* If a partial specialization of a member template is declared within a classRichard Smith2013-09-261-0/+23
| | | | | | | | | template and defined outside it, don't instantiate it twice when instantiating the surrounding class template specialization. That would cause us to reject the code because we think two partial specializations instantiated to produce the same signature. llvm-svn: 191418
* Implement C++1y digit separator proposal (' as a digit separator). This is notRichard Smith2013-09-263-5/+39
| | | | | | yet approved by full committee, but was unanimously supported by EWG. llvm-svn: 191417
* [OPENMP] Improved variable lookup procedure for threadprivate variables.Alexey Bataev2013-09-262-4/+13
| | | | llvm-svn: 191416
* ObjectiveC: Handle the case of qualifying protocolsFariborz Jahanian2013-09-251-0/+24
| | | | | | | | | declared in a typedef declaraton used as super class of an ObjC class. Curretnly, these protocols are dropped from the class hierarchy. Test shows that it is now included. // rdar://15051465 llvm-svn: 191395
OpenPOWER on IntegriCloud