summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Warn when message is sent to receiver ofFariborz Jahanian2010-12-211-0/+47
| | | | | | | | unknown type and there is a possibility that at runtime method is resolved to a deprecated or unavailable method. Addreses // rdar://8769853 llvm-svn: 122294
* Extend the parser to support pack expansions within exceptionDouglas Gregor2010-12-201-0/+18
| | | | | | | specifications. We can't yet instantiate them, however, since I tripped over PR8835. llvm-svn: 122292
* Test template instantiation of pack expansions where the parameter pack is ↵Douglas Gregor2010-12-201-3/+16
| | | | | | in a nested-name-specifier llvm-svn: 122282
* Clean up the printing of template argument packs; previously, we wereDouglas Gregor2010-12-202-2/+2
| | | | | | getting extra "<>" delimiters around template argument packs. llvm-svn: 122280
* Implement basic support for template instantiation of pack expansionsDouglas Gregor2010-12-202-0/+34
| | | | | | | | | | | | | | | | | whose patterns are template arguments. We can now instantiate, e.g., typedef tuple<pair<OuterTypes, InnerTypes>...> type; where OuterTypes and InnerTypes are template type parameter packs. There is a horrible inefficiency in TemplateArgumentLoc::getPackExpansionPattern(), where we need to create copies of TypeLoc data because our interfaces traffic in TypeSourceInfo pointers where they should traffic in TypeLocs instead. I've isolated in efficiency in this one routine; once we refactor our interfaces to traffic in TypeLocs, we can eliminate it. llvm-svn: 122278
* When checking a template argument list against a template containingDouglas Gregor2010-12-201-0/+9
| | | | | | | | | | | | a parameter pack, check the parameter pack against each of the template arguments it corresponds to, then pack the converted arguments into a template argument pack. Allows us to use variadic class templates so long as instantiation isn't required, e.g., template<typename... Types> struct Tuple; Tuple<int, float> *t2; llvm-svn: 122251
* Adding a line for XFAIL win32 broke the test.Francois Pichet2010-12-201-1/+0
| | | | | | Remove a line: this test is line position sensitive. llvm-svn: 122231
* XFAIL vtable-debug-info.cpp on WIN32 and fix curly brace.Francois Pichet2010-12-201-1/+5
| | | | llvm-svn: 122230
* test/PCH/reloc.c fails on Win32. Francois Pichet2010-12-201-0/+1
| | | | | | XFAIL for now, I'll investigate why later. llvm-svn: 122229
* Disable this test on Windows; it crashes and popup an dialog on each lit ↵Francois Pichet2010-12-201-0/+5
| | | | | | | | test run. I have no idea how to fix it. llvm-svn: 122227
* Emit an error if operator __uuidof() is called on a type with no associated ↵Francois Pichet2010-12-202-45/+49
| | | | | | GUID. llvm-svn: 122226
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-201-2/+14
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Validate Microsoft's uuid attribute string.Francois Pichet2010-12-201-1/+9
| | | | llvm-svn: 122220
* If the initializer is an rvalue and the variable is a const reference,Zhongxing Xu2010-12-191-1/+1
| | | | | | create a temporary object for it. llvm-svn: 122161
* Fix test. I added one last test and then forget to re-check.John McCall2010-12-181-1/+1
| | | | llvm-svn: 122137
* Apply attributes to explicit specializations. Specializations whichJohn McCall2010-12-181-0/+55
| | | | | | | don't provide their own explicit visibility attributes should get them from the template. Fixes rdar://problem/8778497. llvm-svn: 122136
* Warn when synthesizing a property which isFariborz Jahanian2010-12-171-0/+13
| | | | | | | implicitly atomic under -Wimplicit-atomic-properties flag. // rdar://8774580 llvm-svn: 122095
* Swap the order of the condition and body of a do-while statement inDouglas Gregor2010-12-171-1/+22
| | | | | | the AST, so that we visit them in source order. Fixes <rdar://problem/8779113>. llvm-svn: 122062
* Avoid to emit redundant implicit cast for enum constants init expressions.Abramo Bagnara2010-12-171-1/+0
| | | | llvm-svn: 122056
* Fix assertion failure in cocoa::deriveNamingConvention()Ted Kremenek2010-12-171-0/+4
| | | | | | when the selector is the string 'mutable'. llvm-svn: 122046
* Revise Cocoa conventions detection: 'copy' and 'mutableCopy'Ted Kremenek2010-12-172-6/+10
| | | | | | | | only indicates the create rule if it starts at the beginning of the method name, not within the method name. llvm-svn: 122036
* Give hidden visibility to RTTI for derived types. This is kindof a hackyJohn McCall2010-12-171-0/+10
| | | | | | way to do this, but it fixes rdar://problem/8778973 llvm-svn: 122033
* Microsoft's __uuidof operator returns a lvalue.Francois Pichet2010-12-171-0/+2
| | | | llvm-svn: 122021
* Do lvalue-to-rvalue conversions on the LHS of a shift operator.John McCall2010-12-162-2/+0
| | | | | | Fixes rdar://problem/8776586. llvm-svn: 121992
* Add tests checking for unexpanded parameter packs in declarations thatDouglas Gregor2010-12-161-1/+20
| | | | | | | occur within statements. Teach Sema::ActOnExceptionDeclarator() to check for unexpanded parameter packs in the exception type. llvm-svn: 121984
* Check for unexpanded parameter packs in non-type template parameter types.Douglas Gregor2010-12-161-0/+3
| | | | llvm-svn: 121964
* Check for unexpanded parameter packs in default arguments.Douglas Gregor2010-12-161-0/+9
| | | | llvm-svn: 121962
* Tweak location of diagnostic for -Wunreachable-codeTed Kremenek2010-12-161-2/+4
| | | | | | | | | | test due to recent changes to the CFG. The diagnostic is somewhat in the wrong place, but the -Wunreachable-code diagnostic needs to be revamped anyway since most of the diagnostics in this test case are redundant. llvm-svn: 121961
* Start migration of static analyzer to using theTed Kremenek2010-12-165-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit lvalue-to-rvalue casts that John McCall recently introduced. This causes a whole bunch of logic in the analyzer for handling lvalues to vanish. It does, however, raise a few issues in the analyzer w.r.t to modeling various constructs (e.g., field accesses to compound literals). The .c/.m analysis test cases that fail are due to a missing lvalue-to-rvalue cast that will get introduced into the AST. The .cpp failures were more than I could investigate in one go, and the patch was already getting huge. I have XFAILED some of these tests, and they should obviously be further investigated. Some highlights of this patch include: - CFG no longer requires an lvalue bit for CFGElements - StackFrameContext doesn't need an 'asLValue' flag - The "VisitLValue" path from GRExprEngine has been eliminated. Besides the test case failures (XFAILed), there are surely other bugs that are fallout from this change. llvm-svn: 121960
* Check for unexpanded parameter packs within variable initializers.Douglas Gregor2010-12-161-0/+7
| | | | llvm-svn: 121938
* Check for unexpanded parameter packs in friend declarations.Douglas Gregor2010-12-161-0/+4
| | | | llvm-svn: 121934
* Improve diagnostics when property being looked upFariborz Jahanian2010-12-161-0/+11
| | | | | | in a forward @class object. // rdar://8774513 llvm-svn: 121933
* Check for unexpanded parameter packs in using declarations. As aDouglas Gregor2010-12-161-2/+7
| | | | | | | drive-by, make sure to check for unexpanded parameter packs within the name of a declaration. llvm-svn: 121930
* Check for unexpanded parameter packs in enumeration types and enumerators.Douglas Gregor2010-12-161-0/+4
| | | | llvm-svn: 121928
* Check for unexpanded parameter packs in static assertion expressions.Douglas Gregor2010-12-151-0/+1
| | | | llvm-svn: 121922
* ivars craeted for explicit @synthesize and thoseFariborz Jahanian2010-12-152-4/+41
| | | | | | | created for auto-synthesis are @private. Fixes: // rdar://8769582 llvm-svn: 121913
* Check for unexpanded parameter packs in various kinds ofDouglas Gregor2010-12-151-0/+15
| | | | | | | | declarations. This is a work in progress, as I go through the C++ declaration grammar to identify where unexpanded parameter packs can occur. llvm-svn: 121912
* Test that all of the relevant types properly compute the "containsDouglas Gregor2010-12-151-3/+89
| | | | | | | unexpanded parameter pack" bit and that the recursive AST visitor can then find those unexpanded parameter packs. llvm-svn: 121899
* Introduce a RecursiveASTVisitor subclass that finds all unexpandedDouglas Gregor2010-12-151-3/+18
| | | | | | | | | | | | | | | | parameter packs within a statement, type, etc. Use this visitor to provide improved diagnostics for the presence of unexpanded parameter packs in a full expression, base type, declaration type, etc., by highlighting the unexpanded parameter packs and providing their names, e.g., test/CXX/temp/temp.decls/temp.variadic/p5.cpp:28:85: error: declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ... ...VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; ~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ^ llvm-svn: 121883
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-151-0/+70
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* __attribute__((nonnull)) can apply to reference-to-pointerDouglas Gregor2010-12-151-0/+11
| | | | | | parameters. Fixes <rdar://problem/8769025>. llvm-svn: 121864
* Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed ↵Peter Collingbourne2010-12-151-0/+6
| | | | | | | | | | | | | IntegerLiterals BuildExpressionFromIntegralTemplateArgument can produce malformed IntegerLiterals with an EnumType if the template parameter type is an EnumType. This breaks the AST printer which expects all IntegerLiterals to have a plain integer type. Instead, give the IntegerLiteral the enum's promotion type and wrap in an implicit cast to the EnumType. llvm-svn: 121862
* Set the "implicitly inline" bit on a method as soon as we see a definitionJohn McCall2010-12-151-0/+24
| | | | | | | | within the class. Teach IR gen to look for function definitions in record lexical contexts when deciding whether to emit a function whose address was taken. Fixes PR8789. llvm-svn: 121833
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-0/+5
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Generalize this test to work without instruction names.Dan Gohman2010-12-141-2/+2
| | | | llvm-svn: 121742
* Implement CodeGen support for the may_alias attribute.Dan Gohman2010-12-131-0/+21
| | | | llvm-svn: 121734
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-131-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | and TemplateArgument with an operation that determines whether there are any unexpanded parameter packs within that construct. Use this information to diagnose the appearance of the names of parameter packs that have not been expanded (C++ [temp.variadic]p5). Since this property is checked often (every declaration, ever expression statement, etc.), we extend Type and Expr with a bit storing the result of this computation, rather than walking the AST each time to determine whether any unexpanded parameter packs occur. This commit is deficient in several ways, which will be remedied with future commits: - Expr has a bit to store the presence of an unexpanded parameter pack, but it is never set. - The error messages don't point out where the unexpanded parameter packs were named in the type/expression, but they should. - We don't check for unexpanded parameter packs in all of the places where we should. - Testing is sparse, pending the resolution of the above three issues. llvm-svn: 121724
* Remove a type that got reduced away from this test case but not actually ↵Chandler Carruth2010-12-131-1/+0
| | | | | | deleted. llvm-svn: 121694
* Fix PR8774 by restricting when hasInit returns true. Previously, itChandler Carruth2010-12-131-0/+19
| | | | | | | | | | | | | | would return true if the initializer pointer union had *any* non-null pointer in it, even if the pointer wasn't one that would actually be returned via getInit(). This makes it more accurately model the logic of 'getInit() != NULL'. This still isn't completely satisfying. From a principled stance, I suspect we should make hasInit() and getInit() *always* return false and NULL (resp.) for ParmVarDecl. We shouldn't at the API level treat initializers and default arguments as the same thing. llvm-svn: 121692
* Sema: diagnose kernel functions with non-void return typePeter Collingbourne2010-12-121-0/+3
| | | | llvm-svn: 121653
OpenPOWER on IntegriCloud