Douglas Gregor [Fri, 1 Jan 2010 00:15:04 +0000 (00:15 +0000)]
When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:
test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
mean 'NSString'?
NSstring *str = @"A string";
...
^
1 diagnostic generated.
Douglas Gregor [Fri, 1 Jan 2010 00:03:05 +0000 (00:03 +0000)]
Typo correction for C99 designated field initializers, e.g.,
test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
field in type 'struct Window'; did you mean 'bounds'?
.bunds.
^~~~~
bounds
Anders Carlsson [Thu, 31 Dec 2009 17:44:32 +0000 (17:44 +0000)]
Remove rtti.cpp, it's very fragile and has been marked XFAIL for a while now. Between rtti-layout.cpp and rtti-linkage.cpp, RTTI testing should be covered.
Douglas Gregor [Thu, 31 Dec 2009 09:10:24 +0000 (09:10 +0000)]
Typo correction for C++ base and member initializers, e.g.,
test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
data member or base class; did you mean the base class 'Base'?
Derived() : base(),
^~~~
Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
data member or base class; did you mean the member 'member'?
ember() { }
^~~~~
member
Douglas Gregor [Thu, 31 Dec 2009 08:11:17 +0000 (08:11 +0000)]
Typo correction for template names, e.g.,
typo.cpp:27:8: error: no template named 'basic_sting' in namespace 'std';
did you mean 'basic_string'?
std::basic_sting<char> b2;
~~~~~^~~~~~~~~~~
basic_string
Zhongxing Xu [Thu, 31 Dec 2009 06:13:07 +0000 (06:13 +0000)]
Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.
Chris Lattner [Wed, 30 Dec 2009 22:06:22 +0000 (22:06 +0000)]
when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it. I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.
Douglas Gregor [Wed, 30 Dec 2009 17:04:44 +0000 (17:04 +0000)]
Typo correction for type names when they appear in declarations, e.g., given
tring str2;
we produce the following diagnostic + fix-it:
typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
tring str2;
^~~~~
string
To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.
The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.
Chandler Carruth [Wed, 30 Dec 2009 04:10:01 +0000 (04:10 +0000)]
More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.
Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.
Eli Friedman [Wed, 30 Dec 2009 00:13:48 +0000 (00:13 +0000)]
Make sure to explicitly pass type/value dependence to Expr constructor. This
caught several cases where we were not doing the right thing. I'm
not completely sure all cases are being handled correctly, but this should
be an improvement.
Chandler Carruth [Tue, 29 Dec 2009 08:05:19 +0000 (08:05 +0000)]
Fix support for const_cast<>s of array types which actual change the
CV-qualifiers. Remove an error expectation from the 'good' set of const-cast
test cases. With this patch, the final non-template test case from PR5542
passes. (It's the same as the one already in const-cast.cpp.)
Chandler Carruth [Tue, 29 Dec 2009 07:16:59 +0000 (07:16 +0000)]
Correctly refer to element CVR qualifications when determining if a type is
more or less cv-qualified than another during implicit conversion and overload
resolution ([basic.type.qualifier] p5). Factors the logic out of template
deduction and into the ASTContext so it can be shared.
This fixes several aspects of PR5542, but not all of them.
Chandler Carruth [Tue, 29 Dec 2009 06:17:27 +0000 (06:17 +0000)]
Handle using declarations in overloaded and template functions during ADL and
address resolution. This fixes PR5751.
Also, while we're here, remove logic from ADL which mistakenly included the
definition namespaces of overloaded and/or templated functions whose name or
address is used as an argument.
Promote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
This is needed for the platforms, where bitwidth of "int" is not 32 bits
(e.g. 16 on msp430).
Eli Friedman [Sat, 26 Dec 2009 03:35:45 +0000 (03:35 +0000)]
Don't look through casts when looking for the underlying decl for a function
call; the standard doesn't expect us to, and the program could be doing
something crazy. Fixes PR5882.
Daniel Dunbar [Thu, 24 Dec 2009 21:27:38 +0000 (21:27 +0000)]
Sketch a simple new C++Tests suite for checking that llvm-gcc and clang generate
the same visible symbols, useful for finding ABI/Mangler/vtable/etc. issues.
Douglas Gregor [Thu, 24 Dec 2009 20:56:24 +0000 (20:56 +0000)]
Egregious, disgusting workaround for PR5866. We need to rework how we
keep track of friends within templates, which will provide a real for
PR5866. For now, this makes sure we don't do something entirely stupid
with friends of specializations.
Douglas Gregor [Thu, 24 Dec 2009 20:02:50 +0000 (20:02 +0000)]
When rebuilding a MemberExpr that refers to an anonymous union, be
sure to perform derived-to-base conversions on the base
expression. Fixes PR5868. Proper testcase is coming soon.
Douglas Gregor [Thu, 24 Dec 2009 18:51:59 +0000 (18:51 +0000)]
When transforming CXXExprWithTemporaries and CXXBindTemporaryExpr
expressions (e.g., for template instantiation), just transform the
subexpressions and return those, since the temporary-related nodes
will be implicitly regenerated. Fixes PR5867, but I said that
before...
Douglas Gregor [Thu, 24 Dec 2009 17:16:46 +0000 (17:16 +0000)]
InitializationSequence handles binding to temporaries, so that
argument-passing doesn't have to. Fixes PR5867, where we were binding
a temporary twice in the AST and, therefore, calling its destructor
twice.
John McCall [Thu, 24 Dec 2009 11:09:08 +0000 (11:09 +0000)]
Fix the clang-on-clang build: APFloat reports underflow whenever we get a
denormal, but we only want to diagnose if we underflowed to zero. This
allows people to write constants in the denormal range.
John McCall [Thu, 24 Dec 2009 09:58:38 +0000 (09:58 +0000)]
Tweak the text of several main() diagnostics and punch a hole specifically for
Darwin's sekrit fourth argument. This should probably be factored to
let targets make target-specific decisions about what main() should look like.
Fixes rdar://problem/7414990
or if different platforms have radically different ideas of what they want in