Commit Graph

12102 Commits

Author SHA1 Message Date
Eric Christopher 498b7fd7fe Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.

Finishes off the rest of rdar://10246360

llvm-svn: 141732
2011-10-11 23:00:55 +00:00
Eli Friedman 94ab9308d7 PR11062: Make C99 inlining work properly for names with associated builtin libcalls.
llvm-svn: 141723
2011-10-11 22:09:24 +00:00
Richard Smith 7ab47734a2 Fix test: don't use __thread without a target triple.
llvm-svn: 141719
2011-10-11 21:51:31 +00:00
Richard Smith 4dd85d6fa1 Add a -Wc++0x-compat warning for C++11 keywords used as identifiers when in
C++98 mode. Only the first occurrence of each keyword will produce a warning.

llvm-svn: 141700
2011-10-11 19:57:52 +00:00
Daniel Dunbar 0f41eee2a0 Driver: Add support for a new -nostdlibinc option.
- This disables the system include directories, but not the compiler builtin
   directories. Useful for projects that want to use things like the intrinsic
   headers, but are otherwise freestanding.

 - I'm willing to reconsider the option naming, I also considered providing an
   explicit -builtinc (which would match -nobuiltininc), but this is more
   consistent with existing options.

llvm-svn: 141692
2011-10-11 18:20:16 +00:00
Daniel Dunbar b25bfde52d Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.

llvm-svn: 141691
2011-10-11 18:20:10 +00:00
Richard Smith 8128549684 Add more testing for -Wc++0x-compat warnings.
llvm-svn: 141685
2011-10-11 17:38:48 +00:00
Kaelyn Uhrain ad018f10bc Add an explanatory comment to test/SemaCXX/typo-correction.cpp
llvm-svn: 141680
2011-10-11 17:17:40 +00:00
Alexis Hunt 77c1f9f888 Get rid of ShouldDeleteMoveConstructor.
llvm-svn: 141650
2011-10-11 06:43:29 +00:00
Alexis Hunt 1bc6f71ebc Consolidate copy constructor deletion into ShouldDeleteSpecialMember.
llvm-svn: 141645
2011-10-11 04:55:36 +00:00
Anna Zaks fedf5dfc71 [analyzer] Warn about the use of insecure, deprecated vfork() function PR11053 (http://llvm.org/bugs/show_bug.cgi?id=11053).
A patch by Graham Lee!

llvm-svn: 141643
2011-10-11 04:34:54 +00:00
Eli Friedman df14b3a837 Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Francois Pichet 9a57fb5734 [Microsoft] If -fms-compatibility, then downgrade missing typename error to warning at function prototype scope.
llvm-svn: 141630
2011-10-11 01:50:09 +00:00
Lang Hames 83d9f01c7f Added natural stack alignment to target-data.c test case.
llvm-svn: 141622
2011-10-11 01:06:28 +00:00
Kaelyn Uhrain 85308c6ecd Add typo correction for type names.
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.

llvm-svn: 141621
2011-10-11 01:02:41 +00:00
Ted Kremenek 03eec60483 Place diagnostic group ext_typecheck_decl_incomplete_type under a -W flag.
llvm-svn: 141620
2011-10-11 01:02:24 +00:00
Kaelyn Uhrain 0a32fcaf65 Only accept a typo correction if it doesn't trigger additional errors
llvm-svn: 141609
2011-10-11 00:28:39 +00:00
Eli Friedman ce3e02a343 Extend lvalue evaluation in ExprConstant.cpp to handle CK_LValueBitCast (which is completely trivial). PR8836.
llvm-svn: 141604
2011-10-11 00:13:24 +00:00
Douglas Gregor 2259d85a43 Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.
llvm-svn: 141600
2011-10-10 23:44:35 +00:00
Douglas Gregor c7a3107baf When performing a user-defined conversion via a constructor, be sure
to check whether the constructor is accessible. Fixes
<rdar://problem/10202900>.

llvm-svn: 141588
2011-10-10 22:41:00 +00:00
Ted Kremenek 8f34b6999c [analyzer] Teach the static analyzer about CXXForRangeStmt. Patch by Jim Goodnow II!
llvm-svn: 141587
2011-10-10 22:36:31 +00:00
Fariborz Jahanian 55b4e5c208 objc: err on a property designated both atomic and
nonatomic. // rdar://10260017

llvm-svn: 141580
2011-10-10 21:53:24 +00:00
Douglas Gregor ab96bcf6ea When substituting into a sizeof parameter pack expression in a context
where we can't expand (i.e., multi-level substitution), be sure to
substitute the pack with its level-reduced pack. Fixes PR10230.

llvm-svn: 141568
2011-10-10 18:59:29 +00:00
Douglas Gregor 0de5720737 Don't suggest 'noreturn' for function template instantiations, because
it might be wrong for other instantiations of the same function
template. Fixes PR10801.

llvm-svn: 141559
2011-10-10 18:15:57 +00:00
Kaelyn Uhrain 1a6eb99d45 Give nicer note when a member redeclaration has or lacks 'const'
llvm-svn: 141555
2011-10-10 18:01:37 +00:00
Douglas Gregor 6e8da6a291 Don't analyze comparisons in type- or value-dependent
subexpressions. Fixes PR10291.

llvm-svn: 141552
2011-10-10 17:38:18 +00:00
Douglas Gregor 556e5860f9 Per C++ [class.bit]p2, unnamed bit-fields are not members. Fixes PR10289.
llvm-svn: 141549
2011-10-10 17:22:13 +00:00
Richard Smith f368fb40df constexpr: Disable checking of constructor member initializer lists for
constexpr constructor templates. Such checking is optional, and currently hard
to get right since clang doesn't generate implicit member initializers until
instantiation (even for non-dependent members).

This is needed for clang to accept libstdc++ from g++4.6 in c++0x mode.

llvm-svn: 141547
2011-10-10 16:38:04 +00:00
Douglas Gregor bcc9539323 Don't complain about qualified property or ivar access when the
qualifier itself is invalid. Crasher noticed by Fariborz.

llvm-svn: 141544
2011-10-10 16:09:49 +00:00
Douglas Gregor b06fa540e8 When adding a direct initializer to a declaration, allow the
initializer to update the type of the declaration. For example, this
allows us to determine the size of an incomplete array from its
initializer. Fixes PR10288.

llvm-svn: 141543
2011-10-10 16:05:18 +00:00
Douglas Gregor 728d00b8e7 Parse the initializer for a class member after handling its
declarator, so that the declarator is in scope for the
initializer. Fixes PR9989.

llvm-svn: 141539
2011-10-10 14:49:18 +00:00
Douglas Gregor 877d4ebba4 Always add the built-in overload candidates for operators &&, ||, and
!. Fixes PR9865.

llvm-svn: 141537
2011-10-10 14:05:31 +00:00
Alexis Hunt d6da876bac Begin work consolidating ShouldDelete* functions.
Begin with just default constructors. One note is that as a side effect
of this, a conformance test was removed on the basis that this is almost
certainly a defect as with most of union initialization. As it is, clang
does not implement union initialization close to the standard as it's
quite broken as written. I hope to write a paper addressing the issues
eventually.

llvm-svn: 141528
2011-10-10 06:18:57 +00:00
Douglas Gregor 16e65616d6 Implement the restrictions in C++ [class.friend]p6, which disallow
defining a friend function with a qualified name or in a local
class. Fixes PR9853. 

llvm-svn: 141524
2011-10-10 01:11:59 +00:00
Douglas Gregor 12340e5b18 Diagnose attempts to qualify the name of an instance variable or
property in an Objective-C++ member access expression. Fixes PR9759.

llvm-svn: 141522
2011-10-09 23:22:49 +00:00
Douglas Gregor f7b98957ac Push "out-of-line" declarations into scope when their lexical/semantic
redeclaration contexts are the same, as occurs within linkage
specifications. Fixes PR9162.

llvm-svn: 141521
2011-10-09 22:57:49 +00:00
Douglas Gregor 56636589ff The effective context of a friend function is its lexical
context. Fixes PR9103.

llvm-svn: 141520
2011-10-09 22:38:36 +00:00
Douglas Gregor f892c7fe60 For the various CF and NS attributes, don't complain if the parameter
or return types are dependent. Fixes PR9049.

llvm-svn: 141518
2011-10-09 22:26:49 +00:00
Douglas Gregor 0c83c8128b Per the note in C++0x [temp.deduct.call]p4, don't attempt template
argument deduction against a function parameter that has no deducible
template parameters in it. Fixes PR8598.

llvm-svn: 141517
2011-10-09 22:06:46 +00:00
Douglas Gregor e9d075e434 A friend template specialization is also dependent if any of its
template arguments are dependent. Fixes PR10913.

llvm-svn: 141515
2011-10-09 20:59:17 +00:00
Douglas Gregor 668d362503 Only allow taking the address of an expression of type 'overloaded
function type' when that expression is actually an overloaded function
reference (and not the address of an overloaded function
reference). Fixes PR11066. 

llvm-svn: 141514
2011-10-09 19:10:41 +00:00
Douglas Gregor bb64afcc39 Diagnose attempts to declare a non-static data member with a
non-identifier name. Fixes PR10839.

llvm-svn: 141513
2011-10-09 18:55:59 +00:00
Douglas Gregor 4d328b6e16 After instantiating a 'noexcept' expression, be sure to convert it to
a boolean value and check that it is a constant expression. Fixes
PR11084.

llvm-svn: 141511
2011-10-09 18:31:23 +00:00
Fariborz Jahanian 9059124b41 objc: Do not warn about mismatch on Super's readonly property attribute,
related to a readwrite property, and
Sub's readwrite property. // rdar://9396329

llvm-svn: 141497
2011-10-08 17:45:33 +00:00
Argyrios Kyrtzidis f8585fbe57 Try fixing windows bots.
llvm-svn: 141462
2011-10-08 00:54:49 +00:00
Argyrios Kyrtzidis 741fab1358 [arcmt] Ignore linking errors when doing ARC migration, rdar://10247606
llvm-svn: 141434
2011-10-07 22:58:08 +00:00
Ted Kremenek d79719b144 Provide basic static analyzer support for CXXTemporaryObjectExpr. Patch by Jim Goodnow II.
llvm-svn: 141433
2011-10-07 22:48:13 +00:00
Fariborz Jahanian 13d3f86577 objc++: some minor cleanup and a test case
for atomic setters which requires assignment operator.

llvm-svn: 141415
2011-10-07 21:08:14 +00:00
Eli Friedman 73ddccf7d7 Add a simple PCH test for _Atomic.
llvm-svn: 141409
2011-10-07 20:08:35 +00:00
Chandler Carruth 08d0491006 Hack in a workaround for PR11082 until we have a proper fix. This
un-breaks every glib-dependent compile with Clang.

I'm not sure this is even the best workaround, so suggestions welcome.

llvm-svn: 141381
2011-10-07 18:40:27 +00:00