summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateVariadic.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] Pipe type supportXiuli Pan2016-01-091-0/+1
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 llvm-svn: 257254
* Add support for GCC's '__auto_type' extension, per the GCC manual:Richard Smith2015-11-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | https://gcc.gnu.org/onlinedocs/gcc/Typeof.html Differences from the GCC extension: * __auto_type is also permitted in C++ (but only in places where it could appear in C), allowing its use in headers that might be shared across C and C++, or used from C++98 * __auto_type can be combined with a declarator, as with C++ auto (for instance, "__auto_type *p") * multiple variables can be declared in a single __auto_type declaration, with the C++ semantics (the deduced type must be the same in each case) This patch also adds a missing restriction on applying typeof to a bit-field, which GCC has historically rejected in C (due to lack of clarity as to whether the operand should be promoted). The same restriction also applies to __auto_type in C (in both GCC and Clang). This also fixes PR25449. Patch by Nicholas Allegra! llvm-svn: 252690
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-231-2/+2
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-2/+2
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-2/+2
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* [Sema] Factor diags with %plural. No functionality change intended.Benjamin Kramer2015-03-271-9/+4
| | | | llvm-svn: 233387
* Don't crash on an invalid trailing return type on a function before a '...'Nico Weber2014-12-301-5/+5
| | | | | | | | | | | | clang tries to produce a helpful diagnostic for the traiilng '...', but the code that r216778 added for this doesn't expect an invalid trailing return type. Add code to explicitly handle this. Having explicit code for this but not for other things looks a bit strange, but trailing return types are special in that they have a separate existence bit in addition to the type (see r158348). llvm-svn: 224974
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-191-1/+1
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* [c++1z] N4295: fold-expressions.Richard Smith2014-11-081-0/+105
| | | | | | | | | | | | | | | | This is a new form of expression of the form: (expr op ... op expr) where one of the exprs is a parameter pack. It expands into (expr1 op (expr2onwards op ... op expr)) (and likewise if the pack is on the right). The non-pack operand can be omitted; in that case, an empty pack gives a fallback value or an error, depending on the operator. llvm-svn: 221573
* Pass around CorrectionCandidateCallbacks as unique_ptrs soKaelyn Takata2014-10-271-4/+4
| | | | | | TypoCorrectionConsumer can keep the callback around as long as needed. llvm-svn: 220693
* Fix for PR20660, where unexpanded parameter pack in function parameter ↵Larisse Voufo2014-08-291-7/+31
| | | | | | clause causes clang to crash. llvm-svn: 216778
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-111-0/+14
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-291-2/+2
| | | | llvm-svn: 209812
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-5/+5
| | | | llvm-svn: 209613
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-1/+1
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-121-1/+1
| | | | | | class. llvm-svn: 203640
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-021-5/+5
| | | | llvm-svn: 202639
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Remove OpenCL-specific type keywords and specifiersAlp Toker2013-12-181-8/+0
| | | | | | | | | | | | | | | This commit kills off custom type specifier and keyword handling of OpenCL C data types. Although the OpenCL spec describes them as keywords, we can handle them more elegantly as predefined types. This should provide better error correction and code completion as well as simplifying the implementation. The primary intention is however to simplify the C/C++ parser and save some packed bits on AST structures that had been extended in r170432 just for OpenCL. llvm-svn: 197578
* Refactor all diagnosing of TypoCorrections through a common function, inRichard Smith2013-08-171-8/+4
| | | | | | | preparation for teaching this function how to diagnose a correction that includes importing a module. llvm-svn: 188602
* Fix one place I missed that was memcpy'ing TypeLocs in a way that messesEli Friedman2013-06-201-0/+60
| | | | | | | | | up alignment. Fixes utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp from the libc++ testsuite. llvm-svn: 184397
* Re-commit r183466 with a fix to make the TypeLoc casting machinery workEli Friedman2013-06-071-10/+7
| | | | | | | | | correctly in the presence of qualified types. (I had to change the unittest because it was trying to cast a QualifiedTypeLoc to TemplateSpecializationTypeLoc.) llvm-svn: 183563
* Reverts r183466: "Perform dynamic alignment computations..."Manuel Klimek2013-06-071-7/+10
| | | | | | | | | This introduces bugs in TemplateSpecializationTypeLoc's angle bracket locations. Regression test follows in a subsequent commit. llvm-svn: 183513
* Perform dynamic alignment computations so that the data in TypeLocs isEli Friedman2013-06-071-10/+7
| | | | | | | | | | | | | | | correctly aligned. Not performing such computations led to misaligned loads, which crash on some platforms and are generally bad on other platforms. The implementation of TypeLocBuilder::pushImpl is rather messy; code using TypeLocBuilder accidentally assumes that partial TypeLocs are laid out like a complete TypeLoc. As a followup, I intend to work on fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should substantially simplify the implemementation. Fixes PR16144. llvm-svn: 183466
* First pass of semantic analysis for init-captures: check the initializer, buildRichard Smith2013-05-161-2/+6
| | | | | | | | | | | | | a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985
* Implement C++1y decltype(auto).Richard Smith2013-04-261-0/+1
| | | | llvm-svn: 180610
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-211-5/+4
| | | | llvm-svn: 175705
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-201-21/+18
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-1/+2
| | | | | | | | | | | | | | 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
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-071-0/+1
| | | | | | restrictions. llvm-svn: 174601
* This patch makes "&Cls::purevfn" not an odr use. This isn't what the standardNick Lewycky2013-02-021-1/+1
| | | | | | | | | says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use. Also fixes a bug that caused us to not mark the function referenced just because we didn't want to mark it odr used. llvm-svn: 174242
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+1
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+6
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-6/+0
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-0/+6
| | | | llvm-svn: 170428
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | 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
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-0/+1
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* PR12057: Allow variadic template pack expansions to cross lambda boundaries.Richard Smith2012-07-251-25/+64
| | | | | | | | | | Rather than adding a ContainsUnexpandedParameterPack bit to essentially every AST node, we tunnel the bit directly up to the surrounding lambda expression when we reach a context where an unexpanded pack can not normally appear. Thus any statement or declaration within a lambda can now potentially contain an unexpanded parameter pack. llvm-svn: 160705
* PR13386: When matching up parameters between a function template declarationRichard Smith2012-07-181-7/+17
| | | | | | | | | | | and a function template instantiation, if there's a parameter pack in the declaration and one at the same place in the instantiation, don't assume that the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead and check whether the parameter pack was expandable. We can do this as a side-effect of the work we'd need to do anyway, to find how many parameters were produced. llvm-svn: 160416
* For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this isRichard Smith2012-04-041-0/+1
| | | | | | | | | | a type specifier and can be combined with unsigned. This allows libstdc++4.7 to be used with clang in c++98 mode. Several other changes are still required for libstdc++4.7 to work with clang in c++11 mode. llvm-svn: 153999
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-2/+2
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-9/+0
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+16
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Fix the isReferenced bit on parameters in a couple of edge cases. PR12153.Eli Friedman2012-03-011-0/+2
| | | | llvm-svn: 151837
* ArrayRef-icize the function arguments.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151151
* Make the callback object to Sema::CorrectTypo mandatory.Kaelyn Uhrain2012-01-311-1/+1
| | | | llvm-svn: 149451
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+0
| | | | llvm-svn: 148577
* Convert SemaTemplate*.cpp to pass a callback object to CorrectTypo.Kaelyn Uhrain2012-01-131-13/+24
| | | | | | | | The change to SemaTemplateVariadic.cpp improves the typo correction results in certain situations, while the change to SemaTemplate.cpp does not change existing behavior. llvm-svn: 148155
* Check for unexpanded parameter packs in the name that guards aDouglas Gregor2011-10-251-13/+34
| | | | | | | | | Microsoft __if_exists/__if_not_exists statement. Also note that we weren't traversing DeclarationNameInfo *at all* within the RecursiveASTVisitor, which would be rather fatal for variadic templates. llvm-svn: 142906
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+1
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
OpenPOWER on IntegriCloud