summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* objective-c: place quotes around named items in a diagnostic.Fariborz Jahanian2012-06-201-2/+2
| | | | | | // rdar://11671080 llvm-svn: 158874
* objc: tweak my last patch to warn if class extensionFariborz Jahanian2012-06-201-0/+4
| | | | | | has not overridden the property. // rdar://11656982 llvm-svn: 158871
* objective-c: Normally, a property cannot be both 'readonly' and having a Fariborz Jahanian2012-06-202-0/+78
| | | | | | | | | | "write" attribute (copy/retain/etc.). But, property declaration in primary class and protcols are tentative as they may be overridden into a 'readwrite' property in class extensions. Postpone diagnosing such warnings until the class implementation is seen. // rdar://11656982 llvm-svn: 158869
* Added test with sizeof conditions (relies on to-be-implemented functionality ↵Alexander Kornienko2012-06-201-0/+18
| | | | | | of CFG, discussion: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120507/057370.html) llvm-svn: 158854
* Reword -Winternal-linkage-in-inline, and rename it to -Wstatic-in-inline.Jordan Rose2012-06-201-8/+10
| | | | | | | | | Now that this is a C-only warning, we can use "static" instead of "internal linkage", which is a term developers are probably more familiar with. This makes for a better warning message. The warning name was changed to match, since "internal linkage" is not mentioned in the warning text anymore. llvm-svn: 158853
* [analyzer] Malloc: cleanup, disallow free on relinquished memory.Anna Zaks2012-06-201-3/+3
| | | | | | | | This commits sets the grounds for more aggressive use after free checking. We will use the Relinquished sate to denote that someone else is now responsible for releasing the memory. llvm-svn: 158850
* Allow unqualified lookup of non-dependent member functionsNico Weber2012-06-201-0/+29
| | | | | | | | | | in microsoft mode. Fixes PR12701. The code for this was already in 2 of the 3 branches of a conditional and missing in the 3rd branch, so lift it above the conditional. llvm-svn: 158842
* Remove -Winternal-linkage-in-inline in C++.Jordan Rose2012-06-201-105/+0
| | | | | | | | | | | | | | | | It's very easy for anonymous external linkage to propagate in C++ through return types and parameter types. Likewise, it's possible that a template containing an inline function is only used with parameters that have internal linkage. Actually diagnosing where the internal linkage comes from is fairly difficult (both to locate and then to print nicely). Finally, since we only have one translation unit available, we can't even prove that any of this violates the ODR. This warning needs better-defined behavior in C++ before it can really go in. Rewording of the C warning (which /is/ specified by C99) coming shortly. llvm-svn: 158836
* [ms-style asm] Change the fatal error to an extension warning. Apparently, thisChad Rosier2012-06-202-13/+13
| | | | | | | error was asserting on anything that included Windows.h. MS-style inline asm is still dropped, but at least now we're not completely silent about it. llvm-svn: 158833
* objc: improved diagnostic when property autosynthesis may causeFariborz Jahanian2012-06-201-1/+13
| | | | | | change in behavior. // rdar://11671080 llvm-svn: 158828
* Revert "Provide a -no-pedantic to cancel out -pedantic." This needs to be ↵Ted Kremenek2012-06-201-5/+1
| | | | | | | | designed a bit further. We may wish to just have -Wno flags to silence warnings, and not have a -no-pedantic. llvm-svn: 158796
* Restructure how the driver communicates information about theJohn McCall2012-06-20211-270/+280
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* [analyzer] Move failing 'new' test cases back into new.cpp instead of XFAILing.Jordan Rose2012-06-202-21/+31
| | | | | | | | Per Anna's comment, this is a better way to handle "to-do list"-type failures. This way we'll know if any of the features get fixed; in an XFAIL file, /all/ the cases have to be fixed before lit would tell us anything. llvm-svn: 158791
* [analyzer] Invalidate placement args; return the pointer given to placement newJordan Rose2012-06-202-10/+52
| | | | | | | | | | | | | | | | | | | | | | | | | The default global placement new just returns the pointer it is given. Note that other custom 'new' implementations with placement args are not guaranteed to do this. In addition, we need to invalidate placement args, since they may be updated by the allocator function. (Also, right now we don't properly handle the constructor inside a CXXNewExpr, so we need to invalidate the placement args just so that callers know something changed!) This invalidation is not perfect because CallOrObjCMessage doesn't support CXXNewExpr, and all of our invalidation callbacks expect that if there's no CallOrObjCMessage, the invalidation is happening manually (e.g. by a direct assignment) and shouldn't affect checker-specific metadata (like malloc state); hence the malloc test case in new-fail.cpp. But region values are now properly invalidated, at least. The long-term solution to this problem is to rework CallOrObjCMessage into something more general, rather than the morass of branches it is today. <rdar://problem/11679031> llvm-svn: 158784
* [objcmt] Have the modern objc migration warning change from:Argyrios Kyrtzidis2012-06-202-2/+2
| | | | | | | | | | | | | | | [NSNumber numberWithDouble:cppb]; warning: converting to boxing syntax requires a cast to something like: [NSNumber numberWithDouble:cppb]; warning: converting to boxing syntax requires casting 'bool' to 'double' This is way better to fully understand the warning. rdar://11705106 llvm-svn: 158783
* [arcmt] When migrating to ARC disable -Werror so as to only block migrationArgyrios Kyrtzidis2012-06-201-1/+11
| | | | | | | | for "hard" ARC errors, not warnings. rdar://11691437 llvm-svn: 158781
* Add the PCH file name to the message about not being able to read the PCH.Kaelyn Uhrain2012-06-203-0/+13
| | | | | | | | Also add a couple of unit tests to check the invalid-PCH error messages to satisfy PR4568 and for the assertion (introduced in r149918 and fixed in r158769) that would cause clang to crash when given an empty PCH. llvm-svn: 158772
* Structured comment parsing, first step.Dmitri Gribenko2012-06-201-0/+229
| | | | | | | | | * Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang llvm-svn: 158771
* Do a second lookup for type_info in the global namespace in microsoft mode. ↵Nico Weber2012-06-191-0/+8
| | | | | | PR13153. llvm-svn: 158768
* Do not crash when we dynamic cast a final type to void*.Alexis Hunt2012-06-191-0/+5
| | | | llvm-svn: 158763
* Extend the support for cl-std to include 1.2.Tanya Lattner2012-06-191-0/+12
| | | | | | | Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature. Added test case for 1.2 static storage class feature. llvm-svn: 158759
* objective-c: warn when autosynthesizing a property which has sameFariborz Jahanian2012-06-191-3/+4
| | | | | | | | name as an existing ivar since this is common source of error when people remove @synthesize to take advantage of autosynthesis. // rdar://11671080 llvm-svn: 158756
* Reapplying the changes from r158717 as they were rolled back to avoid merge ↵Aaron Ballman2012-06-194-4/+41
| | | | | | conflicts from a separate problematic patch. llvm-svn: 158750
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-194-41/+4
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Fix -Wc++11-narrowing warnings for narrowing negative values to larger unsignedRichard Smith2012-06-191-7/+7
| | | | | | types to actually includes the value, rather than saying <uninitialized>. llvm-svn: 158745
* Enable -Wnull-conversion for non-integral target types (eg: double).David Blaikie2012-06-192-0/+2
| | | | llvm-svn: 158744
* objc-arc: captured block variable accessed in its block literalFariborz Jahanian2012-06-191-0/+11
| | | | | | | | initializer need be null initialized before initializer takes hold, just like any other initialized retainable object pointer. // rdar://11016025 llvm-svn: 158738
* Improves parsing and semantic analysis for MS __declspec attributes. This ↵Aaron Ballman2012-06-194-4/+41
| | | | | | includes support for the align (which fixes PR12631). llvm-svn: 158717
* [analyzer] Allow pointers to escape into NSPointerArray.Anna Zaks2012-06-192-0/+31
| | | | | | (Fixes radar://11691035 PR13140) llvm-svn: 158703
* Fix the location of the fixit for -Wnewline-eof.Jordan Rose2012-06-191-0/+4
| | | | | | | It turns out SourceManager treating the "one-past-the-end" location as invalid, but then failing to set the invalid flag properly. llvm-svn: 158699
* [objcmt] When checking whether the subscripting methods are declared useArgyrios Kyrtzidis2012-06-194-28/+76
| | | | | | | | | ObjCInterfaceDec::lookupInstanceMethod to make sure we check categories as well and update related tests. rdar://11695288 llvm-svn: 158697
* Add a -fuse-init-array option to cc1 and map to the UseInitArray targetRafael Espindola2012-06-191-0/+14
| | | | | | | | | option. On the driver, check if we are using libraries from gcc 4.7 or newer and if so pass -fuse-init-array to the frontend. The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in .ctors, so we have to use .init_array. llvm-svn: 158694
* Improve the error message when a function overload candidate is rejectedKaelyn Uhrain2012-06-193-4/+4
| | | | | | | | | | | | | | | | | because it expects a reference and receives a non-l-value. For example, given: int foo(int &); template<int x> void b() { foo(x); } clang will now print "expects an l-value for 1st argument" instead of "no known conversion from 'int' to 'int &' for 1st argument". The change in wording (and associated code to detect the case) was prompted by comment #5 in PR3104, and should be the last bit of work needed for the bug. llvm-svn: 158691
* Sink definition of IBOutlet, IBOutletCollection, and IBAction intoTed Kremenek2012-06-191-5/+1
| | | | | | | the compiler predefines buffer. These are essentially part of the Objective-C language. llvm-svn: 158690
* Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.Jordan Rose2012-06-182-5/+4
| | | | | | | | | | Per post-commit review, it's not appropriate to use ExtWarn in C++, because we can't prove that the inline function will actually be defined in more than one place (and thus we can't prove that this violates the ODR). This removes the warning entirely from uses in the main source file in C++. llvm-svn: 158689
* XFAIL linker-opts.c on win32 now that it doesn't pretend that link.exe is ld.Michael J. Spencer2012-06-181-1/+1
| | | | llvm-svn: 158687
* Support -Winternal-linkage-in-inline in C++ code.Jordan Rose2012-06-182-1/+107
| | | | | | | | This includes treating anonymous namespaces like internal linkage, and allowing const variables to be used even if internal. The whole thing's been broken out into a separate function to avoid nested ifs. llvm-svn: 158683
* Allow internal decls in inline functions if the function is in the main file.Jordan Rose2012-06-181-7/+43
| | | | | | | | | | | This handles the very common case of people writing inline functions in their main source files and not tagging them as inline. These cases should still behave as the user intended. (The diagnostic is still emitted as an extension.) I'm reworking this code anyway to account for C++'s equivalent restriction in [basic.def.odr]p6, but this should get some bots back to green. llvm-svn: 158666
* [VS Toolchain] Correctly forward -l linker inputs to link.exe.Michael J. Spencer2012-06-181-0/+5
| | | | | | Patch by Nikola Smiljanic! llvm-svn: 158664
* fix PR13071 / rdar://problem/11634669 :Nuno Lopes2012-06-181-0/+4
| | | | | | crash on invalid function decl with alloc_size attribute llvm-svn: 158663
* alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just ↵Nuno Lopes2012-06-181-1/+1
| | | | | | means the function allocates x^2 bytes. GCC also accepts this syntax llvm-svn: 158662
* Handle C++11 attribute namespaces automatically.Alexis Hunt2012-06-181-0/+12
| | | | | | | | Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
* [MSExtensions] Add support for __forceinline.Michael J. Spencer2012-06-181-0/+14
| | | | | | __forceinline is a combination of the inline keyword and __attribute__((always_inline)) llvm-svn: 158653
* Extend the error recovery for a template-argument-list terminated by '>>' toRichard Smith2012-06-183-0/+53
| | | | | | | | | also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to deal with cases where the token is followed by an adjacent '=', '==', '>=', '>>=', or '>>>' token, where a naive fix-it would result in a differing token stream on a re-lex. llvm-svn: 158652
* Don't warn about address-to-member used as part of initialisation, ifJoerg Sonnenberger2012-06-171-0/+4
| | | | | | the member expression is in parentheses. llvm-svn: 158651
* For compatibility with gcc, accept -maltivec as an alias of -faltivec.Hal Finkel2012-06-171-0/+1
| | | | llvm-svn: 158613
* -Wuninitialized bugfix: when entering the scope of a variable with noRichard Smith2012-06-161-0/+25
| | | | | | | initializer, it is uninitialized, even if we may be coming from somewhere where it was initialized. llvm-svn: 158611
* Explicitly build __builtin_va_list.Meador Inge2012-06-161-2/+0
| | | | | | | The target specific __builtin_va_list types are now explicitly built instead of injecting strings into the preprocessor input. llvm-svn: 158592
* Fix Sema and IRGen for atomic compound assignment so it has the right ↵Eli Friedman2012-06-161-3/+12
| | | | | | | | semantics when promotions are involved. (As far as I can tell, this only affects some edge cases.) llvm-svn: 158591
* [analyzer] Array CompoundLiteralExprs need to be treated like lvalues.Jordan Rose2012-06-161-0/+5
| | | | llvm-svn: 158588
OpenPOWER on IntegriCloud