Nick Lewycky [Tue, 7 Jun 2011 06:07:12 +0000 (06:07 +0000)]
The macros defined by the language standard are still available even when the
-undef flag is passed in. Also __ASSEMBLER__ with -x assembler-with-cpp. (Don't
ask.)
Douglas Gregor [Tue, 7 Jun 2011 02:21:18 +0000 (02:21 +0000)]
Downgrade the warning about the use of typedefs for class template
specializations within an explicit instantiation to default to off
(enabled by -pedantic). Nobody else seem to implement C++
[temp.explicit]p3. Fixes PR10093.
Douglas Gregor [Mon, 6 Jun 2011 15:22:55 +0000 (15:22 +0000)]
Diagnose the condition in C++ [temp.expl.spec]p16 that prohibits
specializing a member of an unspecialized template, and recover from
such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>.
Richard Smith [Sun, 5 Jun 2011 22:42:48 +0000 (22:42 +0000)]
Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept due to a lack of proper support for two-phase name lookup.
Sebastian Redl [Sun, 5 Jun 2011 13:59:11 +0000 (13:59 +0000)]
Drop most of InitializationSequence::SequenceKind's values. They didn't really contain any information that the step array didn't contain too. This makes debugging dumps a bit less informative, but probably not significantly so. The advantage is that the redundancy is gone, so the code is easier to understand.
ReferenceBinding is still there, because it is used in some unclear code.
Sebastian Redl [Sun, 5 Jun 2011 12:23:28 +0000 (12:23 +0000)]
Remove all references to InitializationSequence::FailedSequence from outside SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change.
Douglas Gregor [Sun, 5 Jun 2011 06:15:20 +0000 (06:15 +0000)]
Identity and non-identity standard conversion sequences can be
compared even when one is a reference binding and the other is not
(<rdar://problem/9173984>), but the definition of an identity sequence
does not involve lvalue-to-rvalue adjustments (PR9507). Fix both
inter-related issues.
Douglas Gregor [Sun, 5 Jun 2011 05:04:23 +0000 (05:04 +0000)]
When inferring the result type of a block based on a return statement
with a type-dependent expression, infer the placeholder type
'Context.DependentTy' to indicate that this is just a
placeholder. Fixes PR9982 / <rdar://problem/9486685>.
Nick Lewycky [Sat, 4 Jun 2011 05:19:42 +0000 (05:19 +0000)]
Identifiers with _CapitalLetter are reserved, so don't use them. Prefer the
common C++ pattern of using the same name for the constructor argument as you
do for the member. Noticed by inspection.
Jordy Rose [Sat, 4 Jun 2011 01:47:27 +0000 (01:47 +0000)]
[analyzer] Don't crash when copying an unknown number of bytes with memcpy(). Also handle all memcpy-family return values in evalCopyCommon(), rather than having some outside and some inside.
Tanya Lattner [Sat, 4 Jun 2011 00:47:47 +0000 (00:47 +0000)]
Add support for builtin astype:
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
Added test case.
Devang Patel [Sat, 4 Jun 2011 00:38:02 +0000 (00:38 +0000)]
Rework r132576.
Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way.
Improvements to abbreviations for PCH which add support for EnumDecl, ObjCIvarDecl, TypedefDecl, VarDecl and FieldDecl and improve support for ParmVarDecl.
Devang Patel [Fri, 3 Jun 2011 19:21:47 +0000 (19:21 +0000)]
Emit debug info only if there is an insertion point. The debug info should not force an insertion point. Codegen may later on decide to not emit code for some reason, see extensive comment in CodeGenFunction::EmitStmt(), and debug info should not get in the way.
Sean Hunt [Fri, 3 Jun 2011 18:36:49 +0000 (18:36 +0000)]
Begin implementing a cache of special member lookups. Currently only
destructors are implemented but other special members are on the way,
which is where the real benefits of this will be visible.
Hans Wennborg [Fri, 3 Jun 2011 17:37:26 +0000 (17:37 +0000)]
Make -Wignored-qualifiers point to the first ignored qualifier.
In code such as "char* volatile const j()", Clang warns that "volatile
const" will be ignored. Make it point to the first ignored qualifier,
and simplify the code a bit.
We were looking at /usr/lib only if the distro had multilib. This is bogus:
we look in /usr/lib to find crt1.o, and that depends only on where libc
is installed.
This fixes the case of using a different gcc installation in a distro
without multilib.
Douglas Gregor [Fri, 3 Jun 2011 14:28:43 +0000 (14:28 +0000)]
Improve the instantiation of static data members in
Sema::RequireCompleteExprType() a bit more, setting the point of
instantiation if needed, and skipping explicit specializations entirely.
Clean up the "non-POD memaccess" stuff some. This adds a properly named
diagnostic group to cover the cases where we have definitively bad
behavior: dynamic classes.
It also rips out the existing support for POD-based checking. This
didn't work well, and triggered too many false positives. I'm looking
into a possibly more principled way to warn on the fundamental buggy
construct here. POD-ness isn't the critical aspect anyways, so a clean
slate is better. This also removes some silliness from the code until
the new checks arrive.
Douglas Gregor [Fri, 3 Jun 2011 03:35:07 +0000 (03:35 +0000)]
When performing template argument deduction given a function argument
of incomplete array type, attempt to complete the array type. This was
made much easier by Chandler's addition of RequireCompleteExprType(),
which I've tweaked (slightly) to improve the consistency of the
DeclRefExpr. Fixes PR7985.
Douglas Gregor [Fri, 3 Jun 2011 02:59:40 +0000 (02:59 +0000)]
When checking the instantiation of a default template argument against
the template parameter, perform the checking as a "specified" template
argument rather than a "deduced" template argument; the latter implies
stricter type checking that is not permitted for default template
arguments.
Also, cleanup our handling of substitution of explicit template
arguments for a function template. We were actually performing some
substitution of default arguments at this point!
Douglas Gregor [Fri, 3 Jun 2011 02:27:19 +0000 (02:27 +0000)]
Introduce additional abbreviations into the AST writer for
DeclRefExprs, IntegerLiterals, and others, reducing Cocoa PCH size by
~1% and C++ header size by ~2.5%. From Jonathan Turner!
We already have support for using c++ headers from a custom location.
Before this patch we would still link with the system libstdc++. It worked
fine most of the time, but would break if the used headers were a lot newer
than the system libraries.
This patch changes the driver to use the libraries corresponding to the
headers the user selected.
This fixes, for example, using 4.5 headers in a system with gcc 4.1.
Douglas Gregor [Thu, 2 Jun 2011 04:02:27 +0000 (04:02 +0000)]
Tweak code completions for Objective-C Key-Value Observing. The
+keyPathsForValuesAffecting<Key> completion was mislabeled as an
instance method, and +automaticallyNotifiesObserversOf<Key> was
missing entirely. Fixes <rdar://problem/9516762>.
Add the necessary -L option for finding libprofile_rt.a. It might be a good
idea at some point to split out the directories where we install our runtime
libraries.