History log of /external/clang/test/Sema/array-constraint.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b2b5cc0cf908d516a107d373db963f692449a8a8 04-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the diagnostic for negative array sizes to include the
declaration name of the array when present. This ensures that
a poor-man's C++03 static_assert will include the user error message
often embedded in the name.

Update all the tests to reflect the new wording, and add a test for the
name behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
58f9e13e87e57236fee4b914eea9be6f92a1c345 05-Sep-2010 Chris Lattner <sabre@nondot.org> make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
a41a8c5972c2632247ae7913cf6ce65d45f7e702 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
type 'int *' [-pedantic]
f(long_ptr);
^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
d4eea8362605807327735727a9098abe1eb23b19 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
d1969d803cfcc65f1c334df4cc89c7fdd33ee4c9 22-Jul-2009 Mike Stump <mrs@apple.com> Prep for new warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
d7d5f0223bd30dfd618762349c6209dd1d5ea3e6 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
0bfe54fdc83b7b4e37c40e652d86d15aa89885b2 10-Feb-2009 Douglas Gregor <dgregor@apple.com> GNU allows structs with flexible array members to be placed inside
arrays and other structs/unions as an extension. Downgrade our error
to a warning. Fixes PR3540.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64239 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
3cb069213c8502dbb7a67860d40122d869ed8fd6 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
4ec339f43c0cae2678334850c90926bea10999c7 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
211316faa26af4ce594a10bcfc204124fe363362 07-Dec-2008 Chris Lattner <sabre@nondot.org> a minor grammar fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
96e05bc09070aaa7c18d3dd3ff13125a43532f69 07-Dec-2008 Anders Carlsson <andersca@mac.com> Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
1f3105e1eeece9ffdc14d7262c7af486ac76600a 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Change diagnostic per suggestion, to make it a bit clearer what is
happening.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
9a75f8ae17e7f917f491c2e8757bafbf57254c24 18-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule when dealing with arrays.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
d3cd1e56d19474ac785e54c3915d82d2ad7f7fa9 18-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
5cf216b7fa64b933b60743b0b26053e8e7aa87be 04-Jan-2008 Chris Lattner <sabre@nondot.org> Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places. This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.

Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
2fdc3749097a581567dbd9fe66c48c0458bd3e34 10-Dec-2007 Steve Naroff <snaroff@apple.com> Add support for initializing char arrays from string literals.

Adapted from a patch by Anders Carlsson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
3b427b3ba518f7a7293458c2d3d92eebd8458d87 11-Oct-2007 Chris Lattner <sabre@nondot.org> rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
9f3d942e9970bc8f51add390b2a2c46b5a2ab747 26-Sep-2007 Ted Kremenek <kremenek@apple.com> Removed option "-parse-ast-check" from clang driver. This is now implemented
using "-parse-ast -verify".

Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.

Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
d7444aac1af1c2c1d5e5b7467ecf6006ee2d8abe 31-Aug-2007 Steve Naroff <snaroff@apple.com> Removed Sema::VerifyConstantArrayType(). With the new Array/ConstantArray/VariableArray nodes, this
routine was causing more trouble than it was worth. Anders/Chris noticed that it could return an error code
without emiting a diagnostic (which results in an silent invalid decl, which should *never* happen). In addition,
this routine didn't work well for typedefs and field decls. Lastly, it didn't consider that initializers aren't
in place yet.

Added Type::getAsConstantArrayType(), Type::getAsVariableArrayType(), Type::getAsVariablyModifiedType(),
and Type::isVariablyModifiedType();

Modified Sema::ParseDeclarator() and Sema::ParseField() to use the new predicates. Also added a FIXME for
the initializer omission. Also added a missing test for "static" @ file scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
42471f8bc6c1179a54941fac3c483ec1bd319436 31-Aug-2007 Steve Naroff <snaroff@apple.com> Final phase of array cleanup (for now), removing a FIXME from yesterday.

Moved several array constraints checks from Sema::VerifyConstantArrayType() to
Sema::GetTypeForDeclarator(). VerifyConstantArrayType() is now very simple, and
could be removed eventually.

Now, we get the following (correct) messages for BlockVarDecls:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang x.c -pedantic
x.c:4:20: error: size of array has non-integer type 'float'
int size_not_int[f];
^
x.c:5:21: error: array size is negative
int negative_size[1-2];
^~~
x.c:6:17: warning: zero size arrays are an extension
int zero_size[0];
^
3 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
53a3234f4bc3fd5c7e2403321bff9c907e1f2de6 28-Aug-2007 Steve Naroff <snaroff@apple.com> Move the "invalid decl" idiom up to Decl (where we have some bits to steal:-)

Converted ParmVarDecl, FileVarDecl, BlockVarDecl, and Sema::ParseIdentifierExpr() to use the idiom.

Updated array-constraint.c to make sure we no longer get "undeclared identifier" errors:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
26b8ff45bab784183018f79ec95327aac4e7e8b0 26-Aug-2007 Steve Naroff <snaroff@apple.com> Fix bogus warnings (noticed by Chris) with array-constraints.c.

Remove bogus type conversions in Sema::GetTypeForDeclarator(). This commit
only deals with the array types (DeclaratorCheck::Array), though the
rest of this routine should be reviewed. Given the complexity of C declarators,
I don't want to change the entire routine now (will discuss with Chris tomorrow).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
ce7f4cc77f00a4e591596790cf9588e4daf71534 26-Aug-2007 Chris Lattner <sabre@nondot.org> steve's recent changes fixed this bogus warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
f13ebf03b744386649c869014a6b4cf657144ebd 03-Aug-2007 Chris Lattner <sabre@nondot.org> oops, this is the real fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
6f66c26c9482d049375312f9dad2b7f7c18c4cc2 03-Aug-2007 Chris Lattner <sabre@nondot.org> update test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c
5265af5b555f703be365dbc32c4e518fe38d4d9a 19-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a crasher that Neil reported: Sema::GetTypeForDeclarator should never
return a null type. If there is an error parsing the type, pick a new type
for error recovery purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/array-constraint.c