summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Turns #import in MS Mode into an error.Aaron Ballman2012-03-181-0/+17
| | | | llvm-svn: 153009
* Use character literals for vexing initialization fixit hints.David Blaikie2012-03-182-0/+30
| | | | | | | | | | | | | | | Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly for other char types (wide, 16, and 32). Add tests for all these, and since this means testing such hints under C++0x, add tests for some untested C++0x hint cases in the existing code, including suggesting nullptr for pointer initialization. This sets up the initialization helper to provide better type fidelity that will be especially helpful for non-assignment cases (such as fixit-correcting NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead of the less informative foo(0))) llvm-svn: 153008
* Replace a FIXME with a diagnostic when we can't resolve theDouglas Gregor2012-03-181-0/+9
| | | | | | nested-name-specifier for a class template declaration. Fixes PR12291. llvm-svn: 153006
* Diagnose tag and class template declarations with qualifiedDouglas Gregor2012-03-173-2/+25
| | | | | | declarator-ids that occur at class scope. Fixes PR8019. llvm-svn: 153002
* modern objective-c rewriter: further improvement inFariborz Jahanian2012-03-171-0/+7
| | | | | | | | writing @synchronized statement; do not call locking expression more than once and support early exits in @synchronized's statement block (such as return). llvm-svn: 152993
* When determining the availability of an enum constant, also considerDouglas Gregor2012-03-171-6/+6
| | | | | | | the availability of the enumeration type itself. Fixes <rdar://problem/10996386>. llvm-svn: 152977
* [analyzer] Don't claim an object was returned with +1 retain count before ↵Jordy Rose2012-03-171-0/+6
| | | | | | | | counting autoreleases. Fixes PR10376. (Also, 80-column violations.) llvm-svn: 152976
* [analyzer] Add test case from PR10794 for using 'new' with Obj-C objects.Jordy Rose2012-03-171-0/+6
| | | | llvm-svn: 152975
* [analyzer] This test is breaking windows bots, make it darwin-specific.Anna Zaks2012-03-171-1/+1
| | | | | | | (The plist output does not match the one we expect, specifically we do not detect that the interesting symbol is returned by a call.) llvm-svn: 152969
* [analyzer] Shorten the stack hint diagnostic.Anna Zaks2012-03-161-10/+11
| | | | | | | Do not display the standard "Returning from 'foo'", when a stack hint is available. llvm-svn: 152964
* Make the storing variable's name generic.Bill Wendling2012-03-161-1/+1
| | | | llvm-svn: 152963
* [analyzer] Create symbol-aware stack hints (building upon r152837).Anna Zaks2012-03-161-62/+860
| | | | | | | | | | | | | | | | | | The symbol-aware stack hint combines the checker-provided message with the information about how the symbol was passed to the callee: as a parameter or a return value. For malloc, the generated messages look like this : "Returning from 'foo'; released memory via 1st parameter" "Returning from 'foo'; allocated memory via 1st parameter" "Returning from 'foo'; allocated memory returned" "Returning from 'foo'; reallocation of 1st parameter failed" (We are yet to handle cases when the symbol is a field in a struct or an array element.) llvm-svn: 152962
* Escape % in diagnostic message when compiling LLVM IR.Benjamin Kramer2012-03-161-2/+2
| | | | | | | % is a common character in IR so we'd crash on almost any malformed IR. The diagnostic formatter expects a formatting directive when it sees an unescaped %. llvm-svn: 152956
* When "low alignment" is specified, then set the alignment of the aggregate'sBill Wendling2012-03-161-0/+36
| | | | | | | | | | store to 1. This allows code-gen to select a more appropriate alignment. If left to zero, an alignment greater than the alignment of the pointer may be selected, causing code-gen to use instructions which require an alignment greater than the pointer guarantees. <rdar://problem/11043589> llvm-svn: 152951
* modern objective-c translator: write @synchronized.Fariborz Jahanian2012-03-161-0/+23
| | | | | | // rdar://11063663 llvm-svn: 152949
* Suppress macro expansion of NULL in NULL warnings.David Blaikie2012-03-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For "int i = NULL;" we would produce: null.cpp:5:11: warning: implicit conversion of NULL constant to integer [-Wconversion] int i = NULL; ~ ^~~~ null.cpp:1:14: note: expanded from macro 'NULL' \#define NULL __null ^~~~~~ But we really shouldn't trace that macro expansion back into the header, yet we still want macro back traces for code like this: \#define FOO NULL int i = FOO; or \#define FOO int i = NULL; FOO While providing appropriate tagging at different levels of the expansion, etc. The included test case exercises these cases & does some basic validation (to ensure we don't have macro expansion notes where we shouldn't, and do where we should) - but doesn't go as far as to validate the source location/ranges used in those notes and warnings. llvm-svn: 152940
* Skip through transparent contexts when deciding where to add a friend function.Nick Lewycky2012-03-161-0/+8
| | | | | | This fixes g++.dg/parse/friend5.C. llvm-svn: 152938
* modern objective-c translator: writing @throw statement.Fariborz Jahanian2012-03-161-0/+62
| | | | llvm-svn: 152931
* Warn on flexible array members when in C89 mode, with -pedantic.David Chisnall2012-03-161-0/+2
| | | | | | | | This fixes PR 4307. Patch by Eitan Adler! llvm-svn: 152918
* Fix analyzer crash on analyzing 'catch' with no condition variable.Ted Kremenek2012-03-161-0/+23
| | | | llvm-svn: 152900
* test/Driver/linker-opts.c: Mark as XFAIL:cygming, using gcc linker driver. ↵NAKAMURA Takumi2012-03-161-0/+3
| | | | | | It should be aware of LIBRARY_PATH. llvm-svn: 152896
* Add test case for <rdar://problem/8808566>, which is now fixed by inlining ↵Ted Kremenek2012-03-161-0/+43
| | | | | | support. llvm-svn: 152894
* Don't try to create "store atomic" instructions of non-integer types; they ↵Eli Friedman2012-03-161-2/+6
| | | | | | aren't supported at the moment. PR12040. llvm-svn: 152891
* Add warning flag for '#import is a language extension', -W#import-pedantic.Ted Kremenek2012-03-161-2/+1
| | | | | | | Don't know if it is an anathema to include '#' in the warning name. I'm fine with changing it, but this was the most obvious name. llvm-svn: 152886
* modern objective-c translation: writing @try/@catch/@finallyFariborz Jahanian2012-03-151-0/+58
| | | | | | statements. llvm-svn: 152875
* When a variable has a specified asm name, but isn't using the register ↵Eli Friedman2012-03-151-0/+6
| | | | | | storage class, the asm name doesn't specify a register. PR12244. llvm-svn: 152873
* modern objective-c translator: writing @try/@finally statement.Fariborz Jahanian2012-03-151-0/+35
| | | | llvm-svn: 152867
* [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matchesChad Rosier2012-03-152-2/+3
| | | | | | | the behavior of gcc with respect to the -fno-inline and -fno-inline-functions flags. llvm-svn: 152861
* Include full plist output in FileCheck test.Ted Kremenek2012-03-151-3/+5
| | | | llvm-svn: 152859
* Include full plist output in FileCheck test.Ted Kremenek2012-03-151-1470/+1476
| | | | llvm-svn: 152858
* Do not truncate expected plist output in FileCheck test.Ted Kremenek2012-03-151-1/+1
| | | | llvm-svn: 152857
* Support deducing template arguments from nested initializer lists. PR12119.Sebastian Redl2012-03-151-0/+13
| | | | llvm-svn: 152848
* Support '%p' format specifier with block pointers.Ted Kremenek2012-03-151-1/+11
| | | | llvm-svn: 152839
* [analyzer] Allow checkers to supply call stack diagnostic hints for theAnna Zaks2012-03-151-979/+1520
| | | | | | | | | | | | | | | | | | | | | | | | | BugVisitor DiagnosticPieces. When checkers create a DiagnosticPieceEvent, they can supply an extra string, which will be concatenated with the call exit message for every call on the stack between the diagnostic event and the final bug report. (This is a simple version, which could be/will be further enhanced.) For example, this is used in Malloc checker to produce the ", which allocated memory" in the following example: static char *malloc_wrapper() { // 2. Entered call from 'use' return malloc(12); // 3. Memory is allocated } void use() { char *v; v = malloc_wrapper(); // 1. Calling 'malloc_wrappers' // 4. Returning from 'malloc_wrapper', which allocated memory } // 5. Memory is never released; potential memory leak llvm-svn: 152837
* Provide the specific target type in the -Wnull-conversion warning.David Blaikie2012-03-151-4/+8
| | | | llvm-svn: 152835
* modern objective-c translator: rewriting of @catch-stmt.Fariborz Jahanian2012-03-151-0/+31
| | | | llvm-svn: 152830
* Make RecursiveASTVisitor to traverse certain statements using data recursionArgyrios Kyrtzidis2012-03-151-0/+2011
| | | | | | | | to avoid a stack overflow with extreme cases. Part of rdar://10941790. llvm-svn: 152820
* [Sema] Introduce a data recursive evaluator specific to binary operators.Argyrios Kyrtzidis2012-03-151-0/+2010
| | | | | | | | | | | This allows us to handle extreme cases of chained binary operators without causing stack overflow. The binary operators that are handled with the data recursive evaluator are comma, logical, or operators that have operands with integral or enumeration type. Part of rdar://10941790. llvm-svn: 152819
* Fix codegen for vld{3,4}_dup intrinsics.James Molloy2012-03-151-0/+49
| | | | | | Patch by Silviu Baranga! llvm-svn: 152788
* Unpluralize -Wfoo-conversions warnings for consistency.David Blaikie2012-03-156-6/+6
| | | | | | | | | | | | Err on the side of brevity and rename (while providing aliases for the original name) -Wbool-conversions, -Wint-conversions, and -Wvector-conversions for consistency with constant, literal, string, and sign conversion warnings. And name the diagnostic groups explicitly while I'm here rather than rewriting the string in the groups and sema td files. Curiously, vector-conversion is not under -Wconversion. Perhaps it should be. llvm-svn: 152776
* Reapply r152745 (reverted in 152765) now that compiler-rt is fixed.David Blaikie2012-03-153-3/+7
| | | | | | | | | | | | | | | | | Original commit message: Provide -Wnull-conversion separately from -Wconversion. Like GCC, provide a NULL conversion to non-pointer conversion as a separate flag, on by default. GCC's flag is "conversion-null" which we provide for cross compatibility, but in the interests of consistency (with -Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called -Wnull-conversion. Patch by Lubos Lunak. Review feedback by myself, Chandler Carruth, and Chad Rosier. llvm-svn: 152774
* Revert r152745 as it's breaking the internal buildbots.Chad Rosier2012-03-153-7/+3
| | | | | | | Abbreviated commit message: Provide -Wnull-conversion separately from -Wconversion. llvm-svn: 152765
* Adding some more specific tests for enum declspec parsing, to prove that it ↵Aaron Ballman2012-03-151-0/+7
| | | | | | really works. llvm-svn: 152757
* [frontend] Add support for disabling the "inline" keyword using Chad Rosier2012-03-141-1/+2
| | | | | | | | | | | -fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-143-5/+148
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* Provide -Wnull-conversion separately from -Wconversion.David Blaikie2012-03-143-3/+7
| | | | | | | | | | | | | Like GCC, provide a NULL conversion to non-pointer conversion as a separate flag, on by default. GCC's flag is "conversion-null" which we provide for cross compatibility, but in the interests of consistency (with -Wint-conversion, -Wbool-conversion, etc) the canonical Clang flag is called -Wnull-conversion. Patch by Lubos Lunak. Review feedback by myself, Chandler Carruth, and Chad Rosier. llvm-svn: 152745
* When emitting a diagnostic about two-phase name lookup, don't do uselessNick Lewycky2012-03-141-0/+19
| | | | | | qualified name lookups into transparent contexts. llvm-svn: 152739
* [analyzer] Diagnostics: Supply Caller information even if the bug occursAnna Zaks2012-03-141-1/+1
| | | | | | in the callee. llvm-svn: 152734
* [Analyser] Remove unnecessary recursive visits for ExprWithCleanups andErik Verbruggen2012-03-141-0/+22
| | | | | | MaterializeTemporaryExpr. llvm-svn: 152730
* Parse brace initializers as default arguments. PR12236.Sebastian Redl2012-03-141-0/+7
| | | | llvm-svn: 152721
OpenPOWER on IntegriCloud