| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For pointer assignments of VLA types, Clang currently detects when array
dimensions _lower_ than a variable dimension differ, and reports a warning.
However it does not do the same when the _higher_ dimensions differ, a
case that GCC does catch.
These two pointer types
int (*foo)[1][bar][3];
int (*baz)[1][2][3];
are compatible with each another, and the program is well formed if
bar == 2, a matter that is the programmers problem. However the following:
int (*qux)[2][2][3];
would not be compatible with either, because the upper dimension differs
in size. Clang reports baz is incompatible with qux, but not that foo is
incompatible with qux because it doesn't check those higher dimensions.
Fix this by comparing array sizes on higher dimensions: if both are
constants but unequal then report incompatibility; if either dimension is
variable then we can't know either way.
Differential Revision: https://reviews.llvm.org/D47628
llvm-svn: 333989
|
| |
|
|
| |
llvm-svn: 325998
|
| |
|
|
|
|
|
|
|
|
| |
A [*] is only allowed in a declaration for a function, not in its
definition. We didn't correctly recurse while looking for it, causing
us to crash in CodeGen instead of rejecting it.
This fixes PR23151.
llvm-svn: 234363
|
| |
|
|
| |
llvm-svn: 203302
|
| |
|
|
| |
llvm-svn: 149930
|
| |
|
|
|
|
|
|
|
|
| |
folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other
modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code
llvm-svn: 132983
|
| |
|
|
|
|
| |
definitions.
llvm-svn: 94972
|
| |
|
|
|
|
|
|
|
| |
- 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).
llvm-svn: 91446
|
| |
|
|
|
|
| |
handle the construct in question correctly.
llvm-svn: 72581
|
| |
|
|
|
|
| |
a vla is used.
llvm-svn: 72575
|
| |
|
|
|
|
| |
types.
llvm-svn: 71941
|
| |
|
|
| |
llvm-svn: 70162
|
| |
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
| |
|
|
|
|
|
| |
variable declarations where applicable. Also, a few fixes to
TryToFixInvalidVariablyModifiedType for issues that this exposed.
llvm-svn: 65500
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
external declarations to also support external variable
declarations. Unified the code for these two cases into two new
subroutines.
Note that we fail to diagnose cases like the one Neil pointed
out, where a visible non-external declaration hides an external
declaration by the same name. That will require some reshuffling of
name lookup.
llvm-svn: 65385
|
| |
|
|
| |
llvm-svn: 60646
|
| |
|
|
| |
llvm-svn: 60638
|
| |
|
|
|
|
|
| |
expected-foo strings. Now the only allowed characters between
expected-error and {{ is whitespace.
llvm-svn: 59925
|
| |
|
|
|
|
| |
mangled, report it using the diagnostics machinery instead of printf.
llvm-svn: 59924
|
| |
|
|
| |
llvm-svn: 59167
|
| |
|
|
|
|
| |
a bit more clear (rdar://5646070)
llvm-svn: 54606
|
| |
|
|
|
|
| |
not the missing diagnostic.
llvm-svn: 51365
|
| |
|
|
|
|
| |
we now iterate over the whole AST when we destroy it.
llvm-svn: 51363
|
|
|
int foo() {
typedef int x[foo()];
static int y = sizeof(x);
}
previously we'd emit it on the typedef, which made not sense at all.
llvm-svn: 45154
|