| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
don't know we're in a dependent context.
llvm-svn: 292561
|
|
|
|
|
|
|
| |
to treat as an ICE results in undefined behavior. Instead, return the "natural"
result of the operation (signed wraparound / inf / nan).
llvm-svn: 254699
|
|
|
|
|
|
|
|
|
|
| |
dependent expression
inside a GNU statement expression.
rdar://16064952
llvm-svn: 201468
|
|
|
|
|
|
|
|
| |
initialized from a constant expression in C++98, it can be used in
constant expressions, even if it was brace-initialized. Patch by
Rahul Jain!
llvm-svn: 200098
|
|
|
|
|
|
|
|
|
| |
> 'long long' is an extension when C99 mode is not enabled
to
> 'long long' is a C++11 extension
while compiling in C++98 mode.
llvm-svn: 164545
|
|
|
|
| |
llvm-svn: 160415
|
|
|
|
|
|
| |
constant evaluation. <rdar://problem/11874571>.
llvm-svn: 160394
|
|
|
|
|
|
| |
evaluate certain expressions involving invalidly-defined classes.
llvm-svn: 155645
|
|
|
|
|
|
|
|
| |
not integer constant expressions. In passing, fix the 'folding is an extension'
diagnostic to not claim we're accepting the code, since that's not true in
-pedantic-errors mode, and add this diagnostic to -Wgnu.
llvm-svn: 148209
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variable is initialized by a non-constant expression, and pass in the variable
being declared so that earlier-initialized fields' values can be used.
Rearrange VarDecl init evaluation to make this possible, and in so doing fix a
long-standing issue in our C++ constant expression handling, where we would
mishandle cases like:
extern const int a;
const int n = a;
const int a = 5;
int arr[n];
Here, n is not initialized by a constant expression, so can't be used in an ICE,
even though the initialization expression would be an ICE if it appeared later
in the TU. This requires computing whether the initializer is an ICE eagerly,
and saving that information in PCH files.
llvm-svn: 146856
|
|
|
|
|
|
|
|
|
|
| |
(truncated)
floating literal value does not fit into the destination type. Such casts have
undefined behavior at translation time; treating them as non-ICE matches the
behavior of modern gcc versions.
llvm-svn: 146842
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
expression evaluation:
- When folding a non-value-dependent expression, we may try to use the
initializer of a value-dependent variable. If that happens, give up.
- In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
is of integral or enumeration type (a reference isn't OK!)
- In C++11, DeclRefExprs for objects of const literal type initialized with
value-dependent expressions are themselves value-dependent.
- So are references initialized with value-dependent expressions (though this
case is missing from the C++11 standard, along with many others).
llvm-svn: 144056
|
|
|
|
|
|
|
| |
end result. Use this split to propagate state information and diagnostics
through more of constant expression evaluation.
llvm-svn: 142159
|
|
|
|
|
|
|
|
| |
If a switch condition is constant, warn if there's no case for it.
Constant switch conditions do come up in reasonable template code.
llvm-svn: 104010
|
|
|
|
|
|
|
|
|
|
| |
ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for
the width of an integral type. The former includes padding for bools
(to the target's size) while the latter does not, so we woud end up
zero-extending bools to the target width when we shouldn't. Fixes a
crash-on-valid in the included test.
llvm-svn: 101372
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
might not be the right way to do it.
llvm-svn: 72490
|