| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This adds the -Wformat-non-standard flag (off by default,
enabled by -pedantic), which warns about non-standard
things in format strings (such as the 'q' length modifier,
the 'S' conversion specifier, etc.)
llvm-svn: 151154
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
block pointer that returns a block literal which captures (by copy)
the lambda closure itself. Some aspects of the block literal are left
unspecified, namely the capture variable (which doesn't actually
exist) and the body (which will be filled in by IRgen because it can't
be written as an AST).
Because we're switching to this model, this patch also eliminates
tracking the copy-initialization expression for the block capture of
the conversion function, since that information is now embedded in the
synthesized block literal. -1 side tables FTW.
llvm-svn: 151131
|
|
|
|
|
|
| |
warn if the format string argument is a parameter that is not itself declared as a format string with compatible format.
llvm-svn: 151080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType()
only fix a conversion specification enough that Clang wouldn't warn about it,
as opposed to always changing it to use the "canonical" conversion specifier.
(PR11975)
This preserves the user's choice of conversion specifier in cases like:
printf("%a", (long double)1);
where we previously suggested "%Lf", we now suggest "%La"
printf("%x", (long)1);
where we previously suggested "%ld", we now suggest "%lx".
llvm-svn: 150578
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* if, switch, range-based for: warn if semicolon is on the same line.
* for, while: warn if semicolon is on the same line and either next
statement is compound statement or next statement has more
indentation.
Replacing the semicolon with {} or moving the semicolon to the next
line will always silence the warning.
Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp.
llvm-svn: 150515
|
|
|
|
| |
llvm-svn: 150276
|
|
|
|
|
|
| |
Fixes <rdar://problem/8269537>.
llvm-svn: 150260
|
|
|
|
|
|
|
|
|
| |
[expr.prim.lambda]p4, including the current suggested resolution of
core isue 975, which allows multiple return statements so long as the
types match. ExtWarn when user code is actually making use of this
extension.
llvm-svn: 150168
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Complete the lambda class when we finish the lambda expression
(previously, it was left in the "being completed" state)
- Actually return the LambdaExpr object and bind to the resulting
temporary when needed.
- Detect when cleanups are needed while capturing a variable into a
lambda (e.g., due to default arguments in the copy constructor), and
make sure those cleanups apply for the whole of the lambda
expression.
llvm-svn: 150123
|
|
|
|
| |
llvm-svn: 150009
|
|
|
|
| |
llvm-svn: 149998
|
|
|
|
|
|
|
| |
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)
llvm-svn: 149799
|
|
|
|
|
|
|
|
| |
include.
Fix all the transitive include users.
llvm-svn: 149783
|
|
|
|
|
|
| |
a builtin.
llvm-svn: 149657
|
|
|
|
|
|
| |
doesn't suppress quite as many cases. Based off a testcase in the gcc testsuite.
llvm-svn: 149572
|
|
|
|
|
|
|
|
|
|
|
| |
argument in strncat.
The warning is ignored by default since it needs more qualification.
TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.
llvm-svn: 149524
|
|
|
|
|
|
| |
it doesn't feel like general solution.
llvm-svn: 149404
|
|
|
|
| |
llvm-svn: 149394
|
|
|
|
|
|
| |
<rdar://problem/10759934>. Apparently this is a common idiom in Linux (among other places).
llvm-svn: 149359
|
|
|
|
| |
llvm-svn: 149358
|
|
|
|
|
|
| |
As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html
llvm-svn: 149325
|
|
|
|
|
|
|
|
|
| |
expansion.
This is to prevent diagnostic when using NSLocalizedString or CFCopyLocalizedString
macros which are usually used in place of NS and CF strings literals.
llvm-svn: 149268
|
|
|
|
|
|
|
| |
- Remove the printf0 special handling as we treat it as printf anyway.
- Perform basic checks (non-literal, empty) for all formats and not only printf/scanf.
llvm-svn: 149236
|
|
|
|
| |
llvm-svn: 149127
|
|
|
|
|
|
|
|
| |
it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase.
<rdar://problem/10238797>, part 2.
llvm-svn: 149095
|
|
|
|
|
|
| |
make the printed warning a bit more accurate. The new behavior matches gcc's -Wconversion. <rdar://problem/10238797>.
llvm-svn: 149089
|
|
|
|
| |
llvm-svn: 148948
|
|
|
|
| |
llvm-svn: 148890
|
|
|
|
|
|
| |
appropriate.
llvm-svn: 148673
|
|
|
|
|
|
|
|
| |
rely on property's type for its life-time to avoid
bogus warning with -Warc-unsafe-retained-assign.
// rdar://10694932
llvm-svn: 148355
|
|
|
|
|
|
|
| |
PR 10274: format function attribute with the NSString archetype yields no compiler warnings
PR 10275: format function attribute isn't checked in Objective-C methods
llvm-svn: 148324
|
|
|
|
|
|
| |
appropriate or when GCC requires it)
llvm-svn: 148292
|
|
|
|
|
|
|
|
|
|
| |
for FunctionDecl::getMemoryFunctionKind().
This is a follow up on the Chris's review for r148142: We don't want to
pollute FunctionDecl with an extra enum. (To make this work, added
memcmp and family to the library builtins.)
llvm-svn: 148267
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.
Still to do:
- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases
llvm-svn: 148242
|
|
|
|
|
|
|
| |
memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic
could be reused in the analyzer.
llvm-svn: 148142
|
|
|
|
|
|
| |
ownership of property sent to 'super'. // rdar://10640891
llvm-svn: 147868
|
|
|
|
|
|
|
| |
Along the way, move a helper function from SemaChecking.cpp to a more
accessible home in SourceManager.
llvm-svn: 147692
|
|
|
|
|
|
|
|
|
|
| |
address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer.
With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary.
Fixes PR11705.
llvm-svn: 147561
|
|
|
|
|
|
| |
clients. No functionality change.
llvm-svn: 147318
|
|
|
|
|
|
|
| |
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.
llvm-svn: 146753
|
|
|
|
|
|
|
|
|
| |
extension.
This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).
llvm-svn: 146649
|
|
|
|
|
|
| |
in the case of a shifted bitfield. PR11572.
llvm-svn: 146634
|
|
|
|
|
|
| |
MultiSource/Benchmarks/MiBench/security-rijndael; this gets most of it back.
llvm-svn: 146562
|
|
|
|
|
|
| |
The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large.
llvm-svn: 146430
|
|
|
|
|
|
| |
and offer fixits when there is a mismatch.
llvm-svn: 146326
|
|
|
|
|
|
| |
fixing the function-to-bool conversion warning.
llvm-svn: 146280
|
|
|
|
|
|
| |
in addition to underlying type.
llvm-svn: 146254
|
|
|
|
|
|
|
|
|
|
|
|
| |
in addition to underlying type.
For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"
(This is a second attempt after r145697, which got reverted.)
llvm-svn: 146032
|
|
|
|
|
|
|
|
|
|
| |
in the following code:
void test4(bool (&x)(void)) {
while (x);
}
llvm-svn: 145918
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
methods) to bool. E.g.
void foo() {}
if (f) { ... // <- Warns here.
}
Only applies to non-weak functions, and does not apply if the function address
is taken explicitly with the addr-of operator.
llvm-svn: 145849
|