summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Guard lazy synthesis of provisional ivars under the newFariborz Jahanian2011-01-031-1/+1
| | | | | | -fobjc-default-synthesize-properties flag. llvm-svn: 122757
* Support lit fixes for PR8199David Greene2011-01-031-1/+1
| | | | | | | | Replace "clang++" with "clang\+\+" because we have to escape regexp special characters now. This is in preparation for changes to lit to fix PR8199. Tests will fail until the lit part gets committed. llvm-svn: 122753
* Another variadic template metafunction test case: summing values.Douglas Gregor2011-01-031-2/+16
| | | | llvm-svn: 122752
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-0/+49
| | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. llvm-svn: 122751
* Consolidate template metafunction tests for variadic templates into a single ↵Douglas Gregor2011-01-032-28/+32
| | | | | | file llvm-svn: 122748
* When we attempt to create a built-in that involves a library type weDouglas Gregor2011-01-031-1/+4
| | | | | | | | | don't have access to (e.g., fprintf, which needs the library type FILE), fail with a warning and forget about the builtin entirely. Previously, we would actually provide an error, which breaks autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316. llvm-svn: 122744
* Add support for passing variables declared to use a xmm register to asmRafael Espindola2011-01-021-0/+32
| | | | | | statements using the "x" constraint. llvm-svn: 122679
* Produce a better error message for invalid register names.Rafael Espindola2011-01-011-0/+4
| | | | llvm-svn: 122670
* Add support for declaring register contraints in variables. They are only usedRafael Espindola2010-12-301-0/+27
| | | | | | | | | | | | | | in asm statements: register int foo asm("rdi"); asm("..." : ... "r" (foo) ... We also only accept these variables if the constraint in the asm statement is "r". This fixes most of PR3933. llvm-svn: 122643
* Fix PR8796.Rafael Espindola2010-12-291-0/+13
| | | | | | | | The problem was that we were asserting the we never added an empty class to the same offset twice. This is not true for unions, where two members, empty or not, can have the some offset. llvm-svn: 122633
* Added scalar casts test.Abramo Bagnara2010-12-281-0/+141
| | | | llvm-svn: 122599
* More __uuidof validation:Francois Pichet2010-12-271-0/+16
| | | | | | | 1. Do not validate for uuid attribute if the type is template dependent. 2. Search every class declaration and definition for the uuid attribute. llvm-svn: 122578
* Fix for PR8695.David Chisnall2010-12-261-0/+5
| | | | llvm-svn: 122564
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-251-1/+11
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Add basic support for pointer arithmetic inTed Kremenek2010-12-241-7/+3
| | | | | | | | SimpleSValBuilder. This clears up some false positives emitted by ArrayBoundCheckerV2 due to the lack of support for pointer arithmetic. llvm-svn: 122546
* Handle locations coming from macro instantiations properly in ↵Argyrios Kyrtzidis2010-12-241-0/+10
| | | | | | | | SourceManager::isBeforeInTranslationUnit(). Fixes rdar://8790245 and http://llvm.org/PR8821. llvm-svn: 122536
* Fix a thinko in a helper routine for template argument deduction thatDouglas Gregor2010-12-241-1/+31
| | | | | | | | caused an assertion when dealing with non-type template parameter packs. Add some tests for deduction and instantiation of non-type template parameter packs. llvm-svn: 122534
* Non-type template parameter packs cannot have default arguments.Douglas Gregor2010-12-241-0/+10
| | | | llvm-svn: 122533
* When instantiating a non-type template parameter pack, be sure toDouglas Gregor2010-12-241-5/+25
| | | | | | | | extract the appropriate argument from the argument pack (based on the current substitution index, of course). Simple instantiation of pack expansions involving non-type template parameter packs now works. llvm-svn: 122532
* Add an AST representation for non-type template parameterDouglas Gregor2010-12-232-2/+22
| | | | | | | | | | | | | | packs, e.g., template<typename T, unsigned ...Dims> struct multi_array; along with semantic analysis support for finding unexpanded non-type template parameter packs in types, expressions, and so on. Template instantiation involving non-type template parameter packs probably doesn't work yet. That'll come soon. llvm-svn: 122527
* Improve the diagnostic and recovery for missing colons after 'case'Douglas Gregor2010-12-231-1/+9
| | | | | | | | | | | | | | | and 'default' statements, including a Fix-It to add the colon: test/Parser/switch-recovery.cpp:13:12: error: expected ':' after 'case' case 17 // expected-error{{expected ':' after 'case'}} ^ : test/Parser/switch-recovery.cpp:16:12: error: expected ':' after 'default' default // expected-error{{expected ':' after 'default'}} ^ : llvm-svn: 122522
* Implement parsing of function parameter packs and non-type templateDouglas Gregor2010-12-232-0/+79
| | | | | | | | | | | | parameter packs (C++0x [dcl.fct]p13), including disambiguation between unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for cases like void f(T...) where T may or may not contain unexpanded parameter packs. llvm-svn: 122520
* Add -fobjc-default-synthesized-properties flagTed Kremenek2010-12-237-7/+7
| | | | | | | | | | | | to allow us to explicitly control whether or not Objective-C properties are default synthesized. Currently this feature only works when using the -fobjc-non-fragile-abi2 flag (so there is no functionality change), but we can now turn off this feature without turning off all the features coupled with -fobjc-non-fragile-abi2. llvm-svn: 122519
* Reimplement the comparison of a class template partialDouglas Gregor2010-12-231-0/+13
| | | | | | | | | | | specialization's template arguments against the primary template's template arguments using the obvious, correct method of checking the injected-class-name type (C++ [temp.class.spec]p9b3). The previous incarnation of this comparison attempted to use its own formulation of the injected-class-name, which is redudant and, with the introduction of variadic templates, became wrong (again). llvm-svn: 122508
* When forming the injected-class-name of a variadic template, theDouglas Gregor2010-12-231-0/+41
| | | | | | | | | template argument corresponding to a template parameter pack is an argument pack of a pack expansion of that template parameter pack. Implements C++0x [temp.dep.type]p2 (at least, as much of it as we can). llvm-svn: 122498
* It's amazing what you find when you actuallyTed Kremenek2010-12-231-7/+27
| | | | | | | | | | | set the RUN line correctly in a test file! Mark a bunch of tests for ArrayBoundCheckerV2 as FIXME's, as our current lack of pointer arithmetic handling causes these to be all false positives/negatives. llvm-svn: 122471
* Add WIP prototype of a new buffer overflowTed Kremenek2010-12-231-0/+132
| | | | | | | checker based on using raw (symbolic) byte offsets from a base region. llvm-svn: 122469
* Implement the part of C++0x [temp.arg.explicit]p3 that pertains toDouglas Gregor2010-12-231-0/+27
| | | | | | | | | | | | parameter packs. In particular, a parameter pack not otherwise deduced is deduced to an empty parameter pack. The C++0x wording here is a bit unfortunate; this should really only apply to function templates, and it mentions "trailing" parameter packs, which doesn't really make sense in the context of function templates. Will file a core issue separately. llvm-svn: 122463
* Implement the rest of C++0x [temp.deduct.type]p9, which specifies thatDouglas Gregor2010-12-232-1/+26
| | | | | | | | the presence of a pack expansion anywhere except at the end of a template-argument-list causes the entire template-argument-list to be a non-deduced context. llvm-svn: 122461
* Unify the consistency checking for deduced template arguments into aDouglas Gregor2010-12-221-0/+23
| | | | | | | | | single routine. Extend that routine to handle consistency checking for template argument packs, so that we can compare the deduced packs for template parameter packs across different pack expansions. llvm-svn: 122452
* Implement template argument deduction for pack expansions whoseDouglas Gregor2010-12-221-11/+30
| | | | | | | | | | | pattern is a template argument, which involves repeatedly deducing template arguments using the pattern of the pack expansion, then bundling the resulting deductions into an argument pack. We can now handle a variety of simple list-handling metaprograms using variadic templates. See, e.g., the new "count" metaprogram. llvm-svn: 122439
* Complain on missing property getter method onlyFariborz Jahanian2010-12-222-5/+24
| | | | | | | if property-dot expression is decidedly an rvalue. // rdar://8155806. llvm-svn: 122430
* When performing template argument deduction where the argument is aDouglas Gregor2010-12-221-0/+26
| | | | | | | | | | dependent template specialization type, the number of template arguments need not match precisely. Rather than checking the number of arguments eagerly (which does not consider argument packs), let the deduction routine for template argument lists cope with too many/too few arguments. llvm-svn: 122425
* [analyzer] Refactoring: Drop the 'GR' prefix.Argyrios Kyrtzidis2010-12-221-3/+3
| | | | llvm-svn: 122424
* Implicitly expand argument packs when performing template argumentDouglas Gregor2010-12-221-0/+17
| | | | | | | | | | | | deduction. Unify all of the looping over template arguments for deduction purposes into a single place, where argument pack expansion occurs; this is also the hook for deducing from pack expansions, which itself is not yet implemented. For now, at least we can handle a basic "count" metafunction written with variadics. See the new test for the formulation that works. llvm-svn: 122418
* If the unary operator is prefix and an lvalue (in C++), bindZhongxing Xu2010-12-221-1/+0
| | | | | | the location (l-value) to it. llvm-svn: 122396
* After inlining the CXXConstructExpr, bind the temporary object region to it.Zhongxing Xu2010-12-221-1/+0
| | | | | | | | | | | This change is necessary when the variable is a const reference and we need the l-value of the construct expr. After that, when binding the variable, recover the lazy compound value when the variable is not a reference. In Environment, use the value of a no-op cast expression when it has one. Otherwise, blast-through it. llvm-svn: 122388
* For member pointer conversions potentially involving derived-to-baseDouglas Gregor2010-12-211-2/+4
| | | | | | | | | conversions, make sure that the (possibly) derived type is complete before looking for base classes. Finishes the fix for PR8801. llvm-svn: 122363
* When searching for the instantiation of a locally-scoped tagDouglas Gregor2010-12-211-0/+13
| | | | | | | declaration, also look for an instantiation of its previous declarations. Fixes PR8801. llvm-svn: 122361
* In C++, if the user redeclares a builtin function with a type that isDouglas Gregor2010-12-211-0/+9
| | | | | | | | | | | | | | | inconsistent with the type that the builtin *should* have, forget about the builtin altogether: we don't want subsequence analyses, CodeGen, etc., to think that we have a proper builtin function. C is protected from errors here because it allows one to use a library builtin without having a declaration, and detects inconsistent (re-)declarations of builtins during declaration merging. C++ was unprotected, and therefore would crash. Fixes PR8839. llvm-svn: 122351
* When determining which preprocessed entities to traverse in libclang,Douglas Gregor2010-12-213-0/+15
| | | | | | | | take into account the region of interest. Otherwise, we may fail to traverse some important preprocessed entity cursors. Fixes <rdar://problem/8554072>. llvm-svn: 122350
* Fix test to be platform-agnosticDouglas Gregor2010-12-211-1/+1
| | | | llvm-svn: 122348
* Fix a major inconsistency in the representation of Objective-CDouglas Gregor2010-12-212-13/+42
| | | | | | | | | | | | | | | | | | | | classes, categories, protocols, and class extensions, where the methods and properties of these entities would be inserted into the DeclContext in an ordering that doesn't necessarily reflect source order. The culprits were Sema::ActOnMethodDeclaration(), which did not perform the insertion of the just-created method declaration into the DeclContext for these Objective-C entities, and Sema::ActOnAtEnd(), which inserted all method declarations at the *end* of the DeclContext. With this fix in hand, clean up the code-completion actions for property setters/getters that worked around this brokenness in the AST. Fixes <rdar://problem/8062781>, where this problem manifested as poor token-annotation information, but this would have struck again in many other places. llvm-svn: 122347
* Implement BlockDecl::getSourceRange(). The bogus source-rangeDouglas Gregor2010-12-211-0/+34
| | | | | | | information caused token-annotation to fail in funny ways. Fixes <rdar://problem/8595386>. llvm-svn: 122338
* Add test for C++ [temp.friend]p8, which bans partial specializations from ↵Douglas Gregor2010-12-211-0/+6
| | | | | | being friends llvm-svn: 122335
* A class template partial specialization cannot be a friend. Fixes PR8649.Douglas Gregor2010-12-211-0/+9
| | | | llvm-svn: 122325
* When checking a using declaration, make sure that the context we'reDouglas Gregor2010-12-211-0/+10
| | | | | | looking in is complete. Fixes PR8756. llvm-svn: 122323
* Don't try to compute the value of a value-dependent expression whenDouglas Gregor2010-12-211-0/+10
| | | | | | checking trivial comparisons. Fixes PR8795. llvm-svn: 122322
* add missing newlines at end of file.Chris Lattner2010-12-215-5/+5
| | | | llvm-svn: 122309
* Implement instantiation of pack expansions whose pattern is a type-idDouglas Gregor2010-12-211-6/+6
| | | | | | in an exception specification. llvm-svn: 122297
OpenPOWER on IntegriCloud