- Feb 04, 2012
-
-
Benjamin Kramer authored
Fix all the files that depended on transitive includes of Diagnostic.h. With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer. llvm-svn: 149781
-
Richard Smith authored
value of class type, look for a unique conversion operator converting to integral or unscoped enumeration type and use that. Implements [expr.const]p5. Sema::VerifyIntegerConstantExpression now performs the conversion and returns the converted result. Some important callers of Expr::isIntegralConstantExpr have been switched over to using it (including all of those required for C++11 conformance); this switch brings a side-benefit of improved diagnostics and, in several cases, simpler code. However, some language extensions and attributes have not been moved across and will not perform implicit conversions on constant expressions of literal class type where an ICE is required. In passing, fix static_assert to perform a contextual conversion to bool on its argument. llvm-svn: 149776
-
Richard Smith authored
array new expression. This lays some groundwork for the implicit conversion to integral or unscoped enumeration which C++11 ICEs undergo. llvm-svn: 149772
-
Richard Smith authored
llvm-svn: 149770
-
Richard Smith authored
new, is well-formed with defined semantics of throwing (a type which can be caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is somewhere nebulous between undefined behavior and ill-formed. If the array size is an integral constant expression and satisfies one of these criteria, we would previous the array new expression, but now in C++11 mode, we merely issue a warning (the code is still rejected in C++98 mode, naturally). We don't yet implement new C++11 semantics correctly (see PR11644), but we do implement the overflow checking, and (for the default operator new) convert such expressions to an exception, so accepting such code now does not seem especially unsafe. llvm-svn: 149767
-
Nick Lewycky authored
allocator is given the pointer to allocate into. llvm-svn: 149760
-
Sean Callanan authored
want to provide "po"-like functionality which treats the result of an expression implicitly as "id" (if it is not otherwise known) and prints it as an Objective-C object. This has in the past been gated by the "DebuggerSupport" language option, but that is too general. Debuggers also provide other commands like "print" that do not make any assumptions about whether the object is an Objective-C object. This patch makes the assumption conditional on a new language option: DebuggerCastResultToId. I have also made corresponding modifications to the testsuite. llvm-svn: 149735
-
Eli Friedman authored
Suppress the used-but-not-defined warning for static data members while I look into a rather nasty bug in the new odr-use marking code. llvm-svn: 149731
-
Richard Smith authored
The recent support for potential constant expressions exposed a bug in the implementation of libstdc++4.6, where numeric_limits<int>::min() is defined as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr function never produces a constant expression' error inside system headers to compensate. llvm-svn: 149729
-
Eli Friedman authored
llvm-svn: 149719
-
- Feb 03, 2012
-
-
Eli Friedman authored
Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases. llvm-svn: 149718
-
Douglas Gregor authored
template without a corresponding parameter pack, don't immediately substitute the alias template. This is under discussion in the C++ committee, and may become ill-formed, but for now we match GCC. llvm-svn: 149697
-
Hans Wennborg authored
Also, in C, call this a C11 extension rather than a GNU extension. llvm-svn: 149695
-
Douglas Gregor authored
template. Such pack expansions can easily fail at template instantiation time, if the expanded parameter packs are of the wrong length. Fixes <rdar://problem/10040867>, PR9021, and the example that came up today at Going Native. llvm-svn: 149685
-
Argyrios Kyrtzidis authored
available. llvm-svn: 149675
-
Richard Smith authored
* When we detect that a CFG block has inconsistent lock sets, point the diagnostic at the location where we found the inconsistency, and point a note at somewhere the inconsistently-locked mutex was locked. * Fix the wording of the normal (non-loop, non-end-of-function) case of this diagnostic to not suggest that the mutex is going out of scope. * Fix the diagnostic emission code to keep a warning and its note together when sorting the diagnostics into source location order. llvm-svn: 149669
-
Chad Rosier authored
a cast to the same type is allowed so long as it does not cast away constness. Fix for PR11747. Patch by Aaron Ballman. Reviewed by Eli. llvm-svn: 149664
-
Eli Friedman authored
Refactor capture in blocks to use new-style capture hooks. Start adding a bit of the code for lambdas. The only visible changes are that we use the C++11 odr-used rules to figure out when a variable is captured, and type-checking in lambdas is slightly more accurate. llvm-svn: 149663
-
Eli Friedman authored
Note whether a lambda is mutable in the LambdaScopeInfo; this information will be necessary to handle references to captured variables. llvm-svn: 149660
-
Anna Zaks authored
a builtin. llvm-svn: 149657
-
Fariborz Jahanian authored
it is treated as of 'id' type resulting in multiple method lookup. // rdar://10686120 llvm-svn: 149653
-
Eli Friedman authored
llvm-svn: 149641
-
- Feb 02, 2012
-
-
Fariborz Jahanian authored
llvm-svn: 149639
-
Benjamin Kramer authored
Initialize the user defined conversion function to null if this is an aggregate initialization from an initializer list. Found by valgrind. llvm-svn: 149627
-
Fariborz Jahanian authored
type in continuation class. llvm-svn: 149625
-
Fariborz Jahanian authored
property to 'readwrite', also allow redeclaration of property type to a narrowring object type. // rdar://10790488 llvm-svn: 149614
-
Matt Beaumont-Gay authored
llvm-svn: 149610
-
Eli Friedman authored
Split Sema::MarkDeclarationReferenced into multiple functions; the additional entry points are needed to implement C++11 odr-use marking correctly. No functional change in this patch; I'll actually make the change which fixes the odr-use marking in a followup patch. llvm-svn: 149586
-
Fariborz Jahanian authored
is declaring ivars. // rdar://10752081 llvm-svn: 149573
-
Eli Friedman authored
Change the check for constant-conversion with width-1 bitfields so it doesn't suppress quite as many cases. Based off a testcase in the gcc testsuite. llvm-svn: 149572
-
Rafael Espindola authored
llvm-svn: 149559
-
- Feb 01, 2012
-
-
Fariborz Jahanian authored
changing the diagnostic. Also use correct spelling for both. llvm-svn: 149554
-
Anna Zaks authored
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
-
Douglas Gregor authored
llvm-svn: 149517
-
Douglas Gregor authored
cleans up and improves a few things: - We get rid of the ugly dance of computing all of the captures in data structures that clone those of CapturingScopeInfo, centralizing the logic for accessing/updating these data structures - We re-use the existing capture logic for 'this', which actually works now. Cleaned up some diagnostic wording in minor ways as well. llvm-svn: 149516
-
Douglas Gregor authored
type, be sure to add the qualifier for the enumeration type. llvm-svn: 149471
-
Richard Smith authored
a literal type. Disallow it as the return type of a constexpr function declaration. llvm-svn: 149469
-
Douglas Gregor authored
- Actually building the var -> capture mapping properly (there was an off-by-one error) - Keeping track of the source location of each capture - Minor QoI improvements, e.g, highlighing the prior capture if there are multiple captures, pointing at the variable declaration we found if we reject it. As part of this, add standard citations for the various semantic checks we perform, and note where we're not performing those checks as we should. llvm-svn: 149462
-
Nico Weber authored
Fixes PR11847. Patch from Jason Haslam! llvm-svn: 149460
-
Douglas Gregor authored
llvm-svn: 149458
-