summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Do not parse hexadecimal floating point literals in C++0x mode because they areAlexis Hunt2010-01-101-0/+8
| | | | | | | | | | | | | | | | | | incompatible with user-defined literals, specifically with the following form: 0x1p+1 The preprocessing-number token extends only as far as the 'p'; the '+' is not included. Previously we could get away with this extension as p was an invalid suffix, but now with user-defined literals, 'p' might well be a valid suffix and we are forced to consider it as such. This patch also adds a warning in non-0x C++ modes telling the user that this extension is incompatible with C++0x that is enabled by default (previously and with other languages, we warn only with a compliance option such as -pedantic). llvm-svn: 93135
* Improve code completion by introducing patterns for the various C andDouglas Gregor2010-01-101-0/+170
| | | | | | | | | | | | | | | | | | | | | | C++ grammatical constructs that show up in top-level (namespace-level) declarations, member declarations, template declarations, statements, expressions, conditions, etc. For example, we now provide a pattern for static_cast<type>(expr) when we can have an expression, or using namespace identifier; when we can have a using directive. Also, improves the results of code completion at the beginning of a top-level declaration. Previously, we would see value names (function names, global variables, etc.); now we see types, namespace names, etc., but no values. llvm-svn: 93134
* Make sure this test case tests analyzing both x86_64 and i386 archs.Ted Kremenek2010-01-101-4/+8
| | | | llvm-svn: 93133
* Enhance test case.Zhongxing Xu2010-01-101-0/+5
| | | | llvm-svn: 93101
* try to make this more stable?Chris Lattner2010-01-101-1/+1
| | | | llvm-svn: 93090
* Fix PR5982, a refacto in checking for '=' in a -D argument.Daniel Dunbar2010-01-101-0/+4
| | | | llvm-svn: 93088
* add comment to test.Chris Lattner2010-01-101-1/+3
| | | | llvm-svn: 93085
* implement rdar://7520940: published framework headers shouldChris Lattner2010-01-103-0/+12
| | | | | | | import other headers within the same framework with the full framework path, not with a relative include. llvm-svn: 93083
* Fix overzealous assertion in GRExprEngine::VisitLValue(). ATed Kremenek2010-01-091-0/+26
| | | | | | | | | CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it returns a struct temporary. Currently the analyzer doesn't reason about struct temporary returned by function calls, but we shouldn't crash here either. llvm-svn: 93081
* implement codegen support for preinc as an lvalue, PR5514.Chris Lattner2010-01-091-0/+4
| | | | llvm-svn: 93076
* add a bunch of missing prototypes to testsChris Lattner2010-01-0924-11/+52
| | | | llvm-svn: 93072
* Fix broken diagnostic when returning the address of a stack-allocated array.Ted Kremenek2010-01-091-0/+7
| | | | llvm-svn: 93071
* When binding an rvalue to a reference, create a temporary object. Use Zhongxing Xu2010-01-091-0/+6
| | | | | | | | CXXObjectRegion to represent it. In Environment, lookup a literal expression before make up a value for it. llvm-svn: 93047
* Fix handling in GRExprEngine of 'default' branch in switch statementsTed Kremenek2010-01-081-0/+37
| | | | | | | | | when the default case is winnowed down to be infeasible. When all cases were ruled out (and the analysis state for the default case would be infeasible) we would still consider the default case possible. This fixes PR 5969. llvm-svn: 93017
* Organize testcase into namespaces.John McCall2010-01-081-46/+45
| | | | llvm-svn: 93015
* Change the printing of OR_Deleted overload results to print all the candidates,John McCall2010-01-083-6/+6
| | | | | | | | | | | | | | | not just the viable ones. This is reasonable because the most common use of deleted functions is to exclude some implicit conversion during calls; users therefore will want to figure out why some other options were excluded. Started sorting overload results. Right now it just sorts by location in the translation unit (after putting viable functions first), but we can do better than that. Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better self-documentation. llvm-svn: 92990
* Use -fno-math-errno by default, and remove the IsMathErrnoDefaultDan Gohman2010-01-084-9/+8
| | | | | | targethook, which is no longer being used. This fixes PR5971. llvm-svn: 92987
* clang ObjC rewriter: generated code used in "for (x in y)" loop uses Fariborz Jahanian2010-01-081-0/+7
| | | | | | incorrect cast, causing compile error (fixes radar 7342867). llvm-svn: 92986
* Fix for PR5967: Make const-marking for LLVM globals correct for cases requiringEli Friedman2010-01-084-11/+29
| | | | | | | run-time initialization, and emit run-time initializers aggresively to avoid ordering issues with deferred globals. llvm-svn: 92976
* Improve the fix-its for -Wparentheses to ensure that the fix-itDouglas Gregor2010-01-082-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | suggestions follow recovery. Additionally, add a note to these diagnostics which suggests a fix-it for changing the behavior to what the user probably meant. Examples: t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses] if (i & j == k) { ^~~~~~~~ ( ) t.cpp:2:9: note: place parentheses around the & expression to evaluate it first if (i & j == k) { ^ ( ) t.cpp:14:9: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] if (i = f()) { ~~^~~~~ ( ) t.cpp:14:9: note: use '==' to turn this assignment into an equality comparison if (i = f()) { ^ == llvm-svn: 92975
* When parsing an identifier as an expression in C++, only try to annotate itJohn McCall2010-01-071-2/+3
| | | | | | | | | | as a type or scope token if the next token requires it. This eliminates a lot of redundant lookups in C++, but there's room for improvement; a better solution would do a single lookup whose kind and results would be passed through the parser. llvm-svn: 92930
* Fix rewriting of ivars. Fixes radar 7490331.Fariborz Jahanian2010-01-071-0/+20
| | | | llvm-svn: 92924
* fix PR5869: mangle static symbols like gcc does to make it easier to diff ↵Nuno Lopes2010-01-071-1/+6
| | | | | | symbol tables llvm-svn: 92911
* Test linkage of typeinfo and typeinfo names for class templatesDouglas Gregor2010-01-071-1/+13
| | | | llvm-svn: 92897
* Improve the lead diagnostic for C++ object subscript expressions withJohn McCall2010-01-072-1/+25
| | | | | | | | | no viable overloads. Use a different message when the class provides no operator[] overloads at all; use it for operator(), too. Partially addresses PR 5900. llvm-svn: 92894
* Change ObjCContainerDecl to contain the entire range for the '@end'Ted Kremenek2010-01-073-43/+30
| | | | | | | | | | | piece of the declaration. The '@' and the 'end' are separate tokens, and require two SourceLocations to accurately track. This change was motivated because ObjCContainerDecl::getSourceRange() would previously not return the entire range of the declaration (the 'end' would be left off). llvm-svn: 92891
* Add a test case for code-completion in the presence of tabsDouglas Gregor2010-01-071-0/+9
| | | | llvm-svn: 92882
* Make this test be ingored for linux.Fariborz Jahanian2010-01-071-1/+1
| | | | llvm-svn: 92880
* Fix the search for visible declarations within a Scope to ensure thatDouglas Gregor2010-01-072-3/+4
| | | | | | | | we look into a Scope that corresponds to a compound statement whose scope was combined with the scope of the function that owns it. This improves typo correction in many common cases. llvm-svn: 92879
* When we typo-correct a base class initializer, point to the base classDouglas Gregor2010-01-071-1/+1
| | | | | | specifier that we corrected to. llvm-svn: 92878
* Whenever we emit a typo-correction diagnostic, also emit a noteDouglas Gregor2010-01-075-19/+20
| | | | | | | pointing to the declaration that we found that has that name (if it is unique). llvm-svn: 92877
* Fixes the test.Fariborz Jahanian2010-01-061-1/+1
| | | | llvm-svn: 92875
* When suggesting a typo correction for an @implementation without aDouglas Gregor2010-01-061-1/+2
| | | | | | | | | | corresponding @interface, provide a note showing which interface we're referring to. This note has the fix-it hint on it. Also, don't automatically apply fix-it hints for notes. They're meant to express fix-its that would change semantics. llvm-svn: 92870
* Change clang_getDeclExtent() to have the endpoint point to the last ↵Ted Kremenek2010-01-061-43/+28
| | | | | | character in the last token. llvm-svn: 92869
* Test case for rewriting of __weak byref objects.Fariborz Jahanian2010-01-061-0/+15
| | | | llvm-svn: 92868
* Don't assert when dealing with unsigned casts of lvalues. Fixes PR5961.John McCall2010-01-061-0/+8
| | | | llvm-svn: 92866
* Add test from PR5913, which has already been fixedDouglas Gregor2010-01-061-0/+13
| | | | llvm-svn: 92863
* Derive tighter ranges for & and >> in the conversion-checking code.John McCall2010-01-061-0/+10
| | | | llvm-svn: 92862
* Add testcase for PR5817, although the bug was already fixedDouglas Gregor2010-01-061-0/+4
| | | | llvm-svn: 92858
* Fix a bug when property is redeclared in multipleFariborz Jahanian2010-01-061-0/+24
| | | | | | | continuation classes and its original declaration is imported from a protocol. This fixes radar 7509234. llvm-svn: 92856
* Fix marking of virtual members for nested classes whose first non-pure ↵Douglas Gregor2010-01-061-0/+12
| | | | | | virtual function has a body inlined in the class llvm-svn: 92855
* Make sure that the key-function computation produces the correctDouglas Gregor2010-01-061-0/+11
| | | | | | | | result for a nested class whose first non-pure virtual member function has an inline body. Previously, we were checking for the key function before we had seen the (delayed) inline body. llvm-svn: 92839
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-0627-54/+49
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Significantly rework the calculation of effective integer-expression rangesJohn McCall2010-01-062-0/+59
| | | | | | | | | | | | for -Wsign-compare and -Wconversion, and use that coordinated logic to drive both diagnostics. The new logic works more transparently with implicit conversions, conditional operators, etc., as well as bringing -Wconversion's ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to -Wsign-compare. Fixes PRs 5887, 5937, 5938, and 5939. llvm-svn: 92823
* Revert my available_externally vtables experiment. It's breaking the ↵Douglas Gregor2010-01-061-1/+1
| | | | | | LLVM-with-Clang build with linker errors that I have yet to investigate. llvm-svn: 92822
* Make our marking of virtual members functions in a class beDouglas Gregor2010-01-063-13/+30
| | | | | | | | | | | | | | | | | | | | | deterministic and work properly with templates. Once a class that needs a vtable has been defined, we now do one if two things: - If the class has no key function, we place the class on a list of classes whose virtual functions will need to be "marked" at the end of the translation unit. The delay until the end of the translation unit is needed because we might see template specializations of these virtual functions. - If the class has a key function, we do nothing; when the key function is defined, the class will be placed on the aforementioned list. At the end of the translation unit, we "mark" all of the virtual functions of the classes on the list as used, possibly causing template instantiation and other classes to be added to the list. This gets LLVM's lib/Support/CommandLine.cpp compiling again. llvm-svn: 92821
* Do not diagnose method disguised as property setterFariborz Jahanian2010-01-061-0/+12
| | | | | | for a 'readonly' property. Fixes radar 7427072. llvm-svn: 92808
* Add C API hook 'clang_getDeclExtent()', which returns the source extent of a ↵Ted Kremenek2010-01-051-30/+29
| | | | | | declaration. This implements <rdar://problem/7280072>. llvm-svn: 92802
* Make use of available_externally linkage for vtables when theDouglas Gregor2010-01-051-0/+37
| | | | | | | | | | non-inline key function of a class template instantiation, when no key function is present, the class template instantiation itself was instantiated with an explicit instantiation declaration (aka extern template). I'm fairly certain that the C++0x specification gives us this lattitude, although GCC doesn't take advantage of it. llvm-svn: 92779
* Improve key-function computation for templates. In particular:Douglas Gregor2010-01-052-0/+64
| | | | | | | | | | | | | | | | - All classes can have a key function; templates don't change that. non-template classes when computing the key function. - We always mark all of the virtual member functions of class template instantiations. - The vtable for an instantiation of a class template has weak linkage. We could probably use available_externally linkage for vtables of classes instantiated by explicit instantiation declarations (extern templates), but GCC doesn't do this and I'm not 100% that the ABI permits it. llvm-svn: 92753
OpenPOWER on IntegriCloud