]> granicus.if.org Git - clang/log
clang
13 years agoRe-instate r123977/r123978, my updates of the reference-binding
Douglas Gregor [Mon, 24 Jan 2011 16:14:37 +0000 (16:14 +0000)]
Re-instate r123977/r123978, my updates of the reference-binding
implementation used by overload resolution to support rvalue
references. The original commits caused PR9026 and some
hard-to-reproduce self-host breakage.

The only (crucial!) difference between this commit and the previous
commits is that we now properly check the SuppressUserConversions flag
before attempting to perform a second user-defined conversion in
reference binding, breaking the infinite recursion chain of
user-defined conversions.

Rvalue references should be working a bit better now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124121 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCheck whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing...
Axel Naumann [Mon, 24 Jan 2011 15:44:00 +0000 (15:44 +0000)]
Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and for other use cases of dependent types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124119 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate the last reference to concepts, from Jean-Daniel Dupas
Douglas Gregor [Mon, 24 Jan 2011 15:22:41 +0000 (15:22 +0000)]
Eliminate the last reference to concepts, from Jean-Daniel Dupas

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124118 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix the __has_attribute example; we don't have an override attribute anymore.
Anders Carlsson [Mon, 24 Jan 2011 03:54:51 +0000 (03:54 +0000)]
Fix the __has_attribute example; we don't have an override attribute anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124106 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix some typos, patch by Jonathan Wakely!
Chris Lattner [Mon, 24 Jan 2011 03:47:59 +0000 (03:47 +0000)]
fix some typos, patch by Jonathan Wakely!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124105 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix a broken example, PR9005, patch by Jonathan Wakely!
Chris Lattner [Mon, 24 Jan 2011 03:47:34 +0000 (03:47 +0000)]
fix a broken example, PR9005, patch by Jonathan Wakely!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124104 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoremove some crazy leftover thing.
Chris Lattner [Mon, 24 Jan 2011 02:53:58 +0000 (02:53 +0000)]
remove some crazy leftover thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124098 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen building a type info struct for EH, we always want it to have linkonce_odr linkage.
Anders Carlsson [Mon, 24 Jan 2011 02:12:11 +0000 (02:12 +0000)]
When building a type info struct for EH, we always want it to have linkonce_odr linkage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124096 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange CodeGenModule::getVTableLinkage to be a non-static member function.
Anders Carlsson [Mon, 24 Jan 2011 02:04:33 +0000 (02:04 +0000)]
Change CodeGenModule::getVTableLinkage to be a non-static member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124095 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago"Name" a bool parameter.
Anders Carlsson [Mon, 24 Jan 2011 01:59:49 +0000 (01:59 +0000)]
"Name" a bool parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124094 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse CharUnits for the offset amount of RegionRawOffset.
Ken Dyck [Mon, 24 Jan 2011 01:55:39 +0000 (01:55 +0000)]
Use CharUnits for the offset amount of RegionRawOffset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124093 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove private toCharUnits() helper method, replacing with calls to
Ken Dyck [Mon, 24 Jan 2011 01:28:50 +0000 (01:28 +0000)]
Remove private toCharUnits() helper method, replacing with calls to
ASTContext::toCharUnitsFromBits().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124092 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of...
Anders Carlsson [Mon, 24 Jan 2011 00:46:19 +0000 (00:46 +0000)]
Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr.

This fixes PR6996.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124089 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGet rid of [[hiding]], [[override]] and [[base_check]].
Anders Carlsson [Sun, 23 Jan 2011 21:33:18 +0000 (21:33 +0000)]
Get rid of [[hiding]], [[override]] and [[base_check]].

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124087 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGet rid of the [[final]] C++0x attribute.
Anders Carlsson [Sun, 23 Jan 2011 21:07:30 +0000 (21:07 +0000)]
Get rid of the [[final]] C++0x attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124083 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for the --noexecstack option. Fixes PR8762.
Rafael Espindola [Sun, 23 Jan 2011 17:58:26 +0000 (17:58 +0000)]
Add support for the --noexecstack option. Fixes PR8762.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124078 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach -Wuninitialized-experimental about sizeof().
Ted Kremenek [Sun, 23 Jan 2011 17:53:04 +0000 (17:53 +0000)]
Teach -Wuninitialized-experimental about sizeof().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124076 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak diagnostic:
Ted Kremenek [Sun, 23 Jan 2011 17:21:34 +0000 (17:21 +0000)]
Tweak diagnostic:

  error: no super class declared in @interface for 'XXX'

to be:

  error: 'X' cannot use 'super' because it is a root class

The latter explains what the user actually did wrong.

Fixes: <rdar://problem/8904409>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124074 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNull initialize a few variables flagged by
Ted Kremenek [Sun, 23 Jan 2011 17:04:59 +0000 (17:04 +0000)]
Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124072 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAccept the C++0x override control keywords as an extension in C++98. This is OK since...
Anders Carlsson [Sat, 22 Jan 2011 23:01:49 +0000 (23:01 +0000)]
Accept the C++0x override control keywords as an extension in C++98. This is OK since the new syntax is unambiguous and can't be confused with C++98 syntax. If anyone disagrees, please shout!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124048 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement [class.derived]p8.
Anders Carlsson [Sat, 22 Jan 2011 22:23:37 +0000 (22:23 +0000)]
Implement [class.derived]p8.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124047 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSerialize and deserialize IsMarkedFinal/IsMarkedExplicit.
Anders Carlsson [Sat, 22 Jan 2011 18:11:02 +0000 (18:11 +0000)]
Serialize and deserialize IsMarkedFinal/IsMarkedExplicit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124041 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMark classes final and/or explicit during class template instantiation.
Anders Carlsson [Sat, 22 Jan 2011 18:07:06 +0000 (18:07 +0000)]
Mark classes final and/or explicit during class template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124040 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMark classes as final or explicit. Diagnose when a class marked 'final' is used as...
Anders Carlsson [Sat, 22 Jan 2011 17:51:53 +0000 (17:51 +0000)]
Mark classes as final or explicit. Diagnose when a class marked 'final' is used as a base.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124039 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd final/explicit getters and setters to CXXRecordDecl.
Anders Carlsson [Sat, 22 Jan 2011 17:22:48 +0000 (17:22 +0000)]
Add final/explicit getters and setters to CXXRecordDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124037 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParse class-virt-specifier-seqs.
Anders Carlsson [Sat, 22 Jan 2011 16:56:46 +0000 (16:56 +0000)]
Parse class-virt-specifier-seqs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124036 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore work on ClassVirtSpecifiers.
Anders Carlsson [Sat, 22 Jan 2011 15:58:16 +0000 (15:58 +0000)]
More work on ClassVirtSpecifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124035 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd test from PR9026.
Rafael Espindola [Sat, 22 Jan 2011 15:34:07 +0000 (15:34 +0000)]
Add test from PR9026.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124034 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorevert r123977 and r123978 to fix PR9026.
Rafael Espindola [Sat, 22 Jan 2011 15:32:35 +0000 (15:32 +0000)]
revert r123977 and r123978 to fix PR9026.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124033 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart stubbing out a ClassVirtSpecifiers class.
Anders Carlsson [Sat, 22 Jan 2011 15:11:37 +0000 (15:11 +0000)]
Start stubbing out a ClassVirtSpecifiers class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124032 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA member function template cannot be virtual.
Anders Carlsson [Sat, 22 Jan 2011 14:43:56 +0000 (14:43 +0000)]
A member function template cannot be virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124031 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse a FunctionType::get overload that doesn't require an empty vector.
Benjamin Kramer [Sat, 22 Jan 2011 12:15:57 +0000 (12:15 +0000)]
Use a FunctionType::get overload that doesn't require an empty vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124029 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove our parse recovery on 'case blah;' and 'default;'.
John McCall [Sat, 22 Jan 2011 09:28:32 +0000 (09:28 +0000)]
Improve our parse recovery on 'case blah;' and 'default;'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124025 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSend code generation for xvalues down the same path as lvalues
Douglas Gregor [Sat, 22 Jan 2011 02:44:21 +0000 (02:44 +0000)]
Send code generation for xvalues down the same path as lvalues

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124023 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDebug info generation for rvalue references
Douglas Gregor [Sat, 22 Jan 2011 01:58:15 +0000 (01:58 +0000)]
Debug info generation for rvalue references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124020 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate const_cast semantics for rvalue references. Add tests for
Douglas Gregor [Sat, 22 Jan 2011 00:19:52 +0000 (00:19 +0000)]
Update const_cast semantics for rvalue references. Add tests for
reinterpret_cast and const_cast using rvalue references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124007 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach static_cast and dynamic_cast about rvalue references.
Douglas Gregor [Sat, 22 Jan 2011 00:06:57 +0000 (00:06 +0000)]
Teach static_cast and dynamic_cast about rvalue references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124006 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a test for "perfect" forwarding
Douglas Gregor [Fri, 21 Jan 2011 22:52:47 +0000 (22:52 +0000)]
Add a test for "perfect" forwarding

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124005 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoProvide -Wuninitialized-experimental fixits
Ted Kremenek [Fri, 21 Jan 2011 22:49:49 +0000 (22:49 +0000)]
Provide -Wuninitialized-experimental fixits
for floats, and also check if 'nil' is declared
when suggesting it for initializing ObjC pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124004 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen throwing an elidable object, first try to treat the subexpression
Douglas Gregor [Fri, 21 Jan 2011 22:46:35 +0000 (22:46 +0000)]
When throwing an elidable object, first try to treat the subexpression
as an rvalue per C++0x [class.copy]p33. If that fails, try again with
the original subexpression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124002 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneralize the NRVO move-construction-based initialization routine. No functionality...
Douglas Gregor [Fri, 21 Jan 2011 21:08:57 +0000 (21:08 +0000)]
Generalize the NRVO move-construction-based initialization routine. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123996 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd basic fixits for -Wuninitialized-experimental
Ted Kremenek [Fri, 21 Jan 2011 19:41:46 +0000 (19:41 +0000)]
Add basic fixits for -Wuninitialized-experimental
to suggest initializations for pointer and
ObjC pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123995 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance -Wuninitialized-experimental diagnostics
Ted Kremenek [Fri, 21 Jan 2011 19:41:41 +0000 (19:41 +0000)]
Enhance -Wuninitialized-experimental diagnostics
to issue the warning at an uninitialized variable's
declaration, but to issue notes at possible
uninitialized uses (which could be multiple).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123994 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the preference for move-construction over copy-construction
Douglas Gregor [Fri, 21 Jan 2011 19:38:21 +0000 (19:38 +0000)]
Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

  MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123992 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWe love parentheses
Douglas Gregor [Fri, 21 Jan 2011 18:20:49 +0000 (18:20 +0000)]
We love parentheses

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123983 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPromote the static getNRVOCandidate() function, which computed the
Douglas Gregor [Fri, 21 Jan 2011 18:05:27 +0000 (18:05 +0000)]
Promote the static getNRVOCandidate() function, which computed the
NRVO candidate for a return statement, to
Sema::getCopyElisionCandidate(), and teach it enough to also determine
the NRVO candidate for a throw expression. We still don't use the
latter information, however.

Along the way, implement core issue 1148, which eliminates copy
elision from catch parameters and clarifies that copy elision cannot
occur from function parameters (which we already implemented).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123982 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement core issue 1164, which concerns the partial ordering of
Douglas Gregor [Fri, 21 Jan 2011 17:29:42 +0000 (17:29 +0000)]
Implement core issue 1164, which concerns the partial ordering of
f(T&) and f(T&&).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123981 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd unique_ptr example to test the use of rvalue references. I'll grow
Douglas Gregor [Fri, 21 Jan 2011 17:06:29 +0000 (17:06 +0000)]
Add unique_ptr example to test the use of rvalue references. I'll grow
this example further as more rvalue-reference features come online.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123980 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd test for overload resolution's preference for binding an rvalue
Douglas Gregor [Fri, 21 Jan 2011 16:48:38 +0000 (16:48 +0000)]
Add test for overload resolution's preference for binding an rvalue
reference to an rvalue rather than binding a const-qualified lvalue
reference to that rvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123979 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate an unused variable
Douglas Gregor [Fri, 21 Jan 2011 16:37:29 +0000 (16:37 +0000)]
Eliminate an unused variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123978 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate the reference-binding implementation used for overload
Douglas Gregor [Fri, 21 Jan 2011 16:36:05 +0000 (16:36 +0000)]
Update the reference-binding implementation used for overload
resolution to match the latest C++0x working paper's semantics. The
implementation now matching up with the reference-binding
implementation used for initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123977 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore testing to C++0x [temp.deduct.call]p3
Douglas Gregor [Fri, 21 Jan 2011 05:24:25 +0000 (05:24 +0000)]
More testing to C++0x [temp.deduct.call]p3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123967 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the special template argument deduction rule for T&& in a
Douglas Gregor [Fri, 21 Jan 2011 05:18:22 +0000 (05:18 +0000)]
Implement the special template argument deduction rule for T&& in a
call (C++0x [temp.deduct.call]p3).

As part of this, start improving the reference-binding implementation
used in the computation of implicit conversion sequences (for overload
resolution) to reflect C++0x semantics. It still needs more work and
testing, of course.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123966 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSema: process non-inheritable attributes on function declarations early
Peter Collingbourne [Fri, 21 Jan 2011 02:08:54 +0000 (02:08 +0000)]
Sema: process non-inheritable attributes on function declarations early

This allows us to simplify the handling for the overloadable attribute,
removing a number of FIXMEs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123961 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSema: support for processing non-inheritable declaration attributes early
Peter Collingbourne [Fri, 21 Jan 2011 02:08:45 +0000 (02:08 +0000)]
Sema: support for processing non-inheritable declaration attributes early

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123960 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneralise support for non-inheritable attributes
Peter Collingbourne [Fri, 21 Jan 2011 02:08:36 +0000 (02:08 +0000)]
Generalise support for non-inheritable attributes

Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time.  By contrast, a non-inheritable attribute
will not be inherited by later redeclarations.  Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.

Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable.  This patch generalises the concept,
while removing a FIXME.  Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).

The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive.  Non-inheritable attributes
simply derive from Attr.

N.B. I did not review every attribute to determine whether it should
be marked non-inheritable.  This can be done later on an incremental
basis, as this change does not affect default functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123959 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd more reference-binding examples from the C++0x working paper, all of which seem...
Douglas Gregor [Fri, 21 Jan 2011 01:11:43 +0000 (01:11 +0000)]
Add more reference-binding examples from the C++0x working paper, all of which seem to be working fine

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123955 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove cheking of kext into canDevirtualizeMemberFunctionCalls().
Fariborz Jahanian [Fri, 21 Jan 2011 01:04:41 +0000 (01:04 +0000)]
Move cheking of kext into canDevirtualizeMemberFunctionCalls().
Improve on test case. Per Doug's comment. wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123954 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImprove the diagnostic that complains about binding an rvalue
Douglas Gregor [Fri, 21 Jan 2011 01:04:33 +0000 (01:04 +0000)]
Improve the diagnostic that complains about binding an rvalue
reference to an lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123953 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore work to bring reference binding up to the latest C++0x
Douglas Gregor [Fri, 21 Jan 2011 00:52:42 +0000 (00:52 +0000)]
More work to bring reference binding up to the latest C++0x
specification. In particular, an rvalue reference can bind to an
initializer expression that is an lvalue if the referent type and the
initializer expression type are not reference-related. This is a newer
formulation to the previous "rvalue references can never bind to
lvalues" rule.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123952 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen performing reference binding via a conversion function, perform
Douglas Gregor [Fri, 21 Jan 2011 00:27:08 +0000 (00:27 +0000)]
When performing reference binding via a conversion function, perform
type checking based on the actual reference type we're trying to bind
the result to, rather than stripping the reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123950 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoInitialize a variable, found by Ted.
Fariborz Jahanian [Thu, 20 Jan 2011 23:34:25 +0000 (23:34 +0000)]
Initialize a variable, found by Ted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123948 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a use of uninitialized variables, found by Ted!
Douglas Gregor [Thu, 20 Jan 2011 23:15:49 +0000 (23:15 +0000)]
Fix a use of uninitialized variables, found by Ted!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123947 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemoving debug printing logic from UninitializedValuesV2.
Ted Kremenek [Thu, 20 Jan 2011 21:25:34 +0000 (21:25 +0000)]
Removing debug printing logic from UninitializedValuesV2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123944 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRelax CFG assertions in UninitializedValuesV2 when
Ted Kremenek [Thu, 20 Jan 2011 21:25:31 +0000 (21:25 +0000)]
Relax CFG assertions in UninitializedValuesV2 when
handling pseudo-path sensitivity, and instead
use those assertion conditions as dynamic checks.
These assertions would be violated when analyzing
a CFG where some branches where optimized away
during CFG construction because their branch
conditions could be trivially determined.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123943 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd test case for <rdar://problem/8891119>. In
Ted Kremenek [Thu, 20 Jan 2011 19:45:14 +0000 (19:45 +0000)]
Add test case for <rdar://problem/8891119>.  In
earlier revisions Clang was incorrectly warning
about an incomplete @implementation when a property
was getting synthesized.  This got fixed somewhere
down the line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123939 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd rudimentary path-sensitivity to UnintializedValuesV2
Ted Kremenek [Thu, 20 Jan 2011 17:37:17 +0000 (17:37 +0000)]
Add rudimentary path-sensitivity to UnintializedValuesV2
analysis for short-circuited operations.  For branch written like "if (x && y)",
we maintain two sets of dataflow values for the outgoing
branches.  This suppresses some common false positives
for -Wuninitialized-experimental.

This change introduces some assertion failures
when running on the LLVM codebase.  WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123923 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoapple kext abi requires all vf calls, including qualified
Fariborz Jahanian [Thu, 20 Jan 2011 17:19:02 +0000 (17:19 +0000)]
apple kext abi requires all vf calls, including qualified
vf calls, be made indirect. This patch is towards that goal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123922 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance AnalysisConsumer to also visit functions
Ted Kremenek [Thu, 20 Jan 2011 17:09:48 +0000 (17:09 +0000)]
Enhance AnalysisConsumer to also visit functions
and methods defined within 'namespace X { ... }'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123921 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore tests for reference binding in the presence of rvalue
Douglas Gregor [Thu, 20 Jan 2011 17:04:36 +0000 (17:04 +0000)]
More tests for reference binding in the presence of rvalue
references. Note that we're currently failing reference binding to a
function lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123920 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart refactoring reference binding to more closely match the C++0x
Douglas Gregor [Thu, 20 Jan 2011 16:44:54 +0000 (16:44 +0000)]
Start refactoring reference binding to more closely match the C++0x
working paper's structure. The only functional change here is that we
now handling binding to array rvalues, which we would previously reject.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123918 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose when a virtual member function marked final is overridden.
Anders Carlsson [Thu, 20 Jan 2011 16:25:36 +0000 (16:25 +0000)]
Diagnose when a virtual member function marked final is overridden.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123916 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMerge test.
Rafael Espindola [Thu, 20 Jan 2011 16:11:21 +0000 (16:11 +0000)]
Merge test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123914 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some tests for reference-collapsing and referencing binding
Douglas Gregor [Thu, 20 Jan 2011 16:08:06 +0000 (16:08 +0000)]
Add some tests for reference-collapsing and referencing binding
involving rvalue references, to start scoping out what is and what
isn't implemented. In the process, tweak some standards citations,
type desugaring, and teach the tentative parser about && in
ptr-operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123913 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix the computation of alignment for fields of packed+aligned structs.
John McCall [Thu, 20 Jan 2011 07:57:12 +0000 (07:57 +0000)]
Fix the computation of alignment for fields of packed+aligned structs.
Part of the fix for PR8413.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123904 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen instantiating member functions, propagate whether the member function is marked...
Anders Carlsson [Thu, 20 Jan 2011 06:52:44 +0000 (06:52 +0000)]
When instantiating member functions, propagate whether the member function is marked 'final' and 'override'.

Also, call CheckOverrideControl when instantiating member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123900 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen checking for functions marked override, ignore dependent contexts.
Anders Carlsson [Thu, 20 Jan 2011 06:33:26 +0000 (06:33 +0000)]
When checking for functions marked override, ignore dependent contexts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123894 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake CheckOverrideControl a member of Sema.
Anders Carlsson [Thu, 20 Jan 2011 06:29:02 +0000 (06:29 +0000)]
Make CheckOverrideControl a member of Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123893 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose virtual member functions marked override but not overriding any virtual...
Anders Carlsson [Thu, 20 Jan 2011 05:57:14 +0000 (05:57 +0000)]
Diagnose virtual member functions marked override but not overriding any virtual member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123888 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix tests to be valid.
Anders Carlsson [Thu, 20 Jan 2011 05:55:43 +0000 (05:55 +0000)]
Fix tests to be valid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123887 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecord...
Anders Carlsson [Thu, 20 Jan 2011 05:36:44 +0000 (05:36 +0000)]
Add IsMarkedOverride and IsMarkedFinal flags to FunctionDecl (to be used by CXXRecordDecl).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123885 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange the parser error to reflect that virt-specifiers are allowed on any class...
Anders Carlsson [Thu, 20 Jan 2011 04:38:09 +0000 (04:38 +0000)]
Change the parser error to reflect that virt-specifiers are allowed on any class member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123883 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly allow virtual member functions to be marked 'override' and 'final'.
Anders Carlsson [Thu, 20 Jan 2011 04:34:22 +0000 (04:34 +0000)]
Only allow virtual member functions to be marked 'override' and 'final'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123882 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd silly test case.
Anders Carlsson [Thu, 20 Jan 2011 04:07:46 +0000 (04:07 +0000)]
Add silly test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123880 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.
Anders Carlsson [Thu, 20 Jan 2011 03:57:25 +0000 (03:57 +0000)]
Pass the VirtSpecifiers along to Sema::ActOnCXXMemberDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123878 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLazily initialize the 'final' and 'override' contextual keywords as suggested by...
Anders Carlsson [Thu, 20 Jan 2011 03:47:08 +0000 (03:47 +0000)]
Lazily initialize the 'final' and 'override' contextual keywords as suggested by Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123876 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd more parser tests for the override control keywords.
Anders Carlsson [Thu, 20 Jan 2011 03:41:12 +0000 (03:41 +0000)]
Add more parser tests for the override control keywords.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123875 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTurns out that the previous commit also fixes this :-)
Rafael Espindola [Thu, 20 Jan 2011 02:57:51 +0000 (02:57 +0000)]
Turns out that the previous commit also fixes this :-)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123873 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
Rafael Espindola [Thu, 20 Jan 2011 02:26:24 +0000 (02:26 +0000)]
Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123871 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd CharUnits::RoundUpToAlignment() to simplify rounding in character units.
Ken Dyck [Thu, 20 Jan 2011 01:59:55 +0000 (01:59 +0000)]
Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123868 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen building a user-defined conversion sequence, keep track of the
Douglas Gregor [Thu, 20 Jan 2011 01:32:05 +0000 (01:32 +0000)]
When building a user-defined conversion sequence, keep track of the
declaration that name lookup actually found, so that we can use it for
access checking later on. Fixes <rdar://problem/8876150>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123867 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
Douglas Gregor [Thu, 20 Jan 2011 00:18:04 +0000 (00:18 +0000)]
Sema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
so allow it to propagate the failure outward. Fixes the crashing part
of <rdar://problem/8876150>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123863 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExplicitly track the number of call arguments provided when performing
Douglas Gregor [Wed, 19 Jan 2011 23:54:39 +0000 (23:54 +0000)]
Explicitly track the number of call arguments provided when performing
overload resolution, so that we only use that number of call arguments
for partial ordering. Fixes PR9006, a recent regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123861 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEradicate any mention of C++0x concepts.
Douglas Gregor [Wed, 19 Jan 2011 23:15:20 +0000 (23:15 +0000)]
Eradicate any mention of C++0x concepts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123860 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoVariadic templates are fully implemented.
Douglas Gregor [Wed, 19 Jan 2011 22:11:50 +0000 (22:11 +0000)]
Variadic templates are fully implemented.

Turn on the __has_feature switch for variadic templates, document
their completion, and put the ExtWarn into the c++0x-extensions
warning group.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123854 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDowngrade the "variadic templates are a C++0x feature" error to an
Douglas Gregor [Wed, 19 Jan 2011 21:59:15 +0000 (21:59 +0000)]
Downgrade the "variadic templates are a C++0x feature" error to an
ExtWarn. We want variadic templates to be usable in libc++/libstdc++
headers even when we're in C++98/03 mode, since it's the only clean
way to implement TR1 <functional>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123852 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactor the dependence computation for DeclRefExpr so that we can
Douglas Gregor [Wed, 19 Jan 2011 21:52:31 +0000 (21:52 +0000)]
Refactor the dependence computation for DeclRefExpr so that we can
reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate
for BlockDeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123851 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement basic support for the use of variadic templates and blocks
Douglas Gregor [Wed, 19 Jan 2011 21:32:01 +0000 (21:32 +0000)]
Implement basic support for the use of variadic templates and blocks
together. In particular:
  - Handle the use of captured parameter pack names within blocks
  (BlockDeclRefExpr understands parameter packs now)
  - Handle the declaration and expansion of parameter packs within a block's
  parameter list, e.g., ^(Args ...args) { ... })
  - Handle instantiation of blocks where the return type was not
  explicitly specified. (unrelated, but necessary for my tests).

Together, these fixes should make blocks and variadic templates work
reasonably well together. Note that BlockDeclRefExpr is still broken
w.r.t. its computation of type and value dependence, which will still
cause problems for blocks in templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123849 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach libclang to generate USRs containing parameter packs and pack expansions.
Douglas Gregor [Wed, 19 Jan 2011 20:50:07 +0000 (20:50 +0000)]
Teach libclang to generate USRs containing parameter packs and pack expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123848 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach libclang about SizeOfPackExpr.
Douglas Gregor [Wed, 19 Jan 2011 20:34:17 +0000 (20:34 +0000)]
Teach libclang about SizeOfPackExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123846 91177308-0d34-0410-b5e6-96231b3b80d8