[Sema] Fix assertion hit while trying to do constant evaluation for a dependent expression
inside a GNU statement expression. rdar://16064952 llvm-svn: 201468
This commit is contained in:
parent
f28703a181
commit
90181d6180
|
@ -8028,6 +8028,8 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {
|
|||
/// an object can indirectly refer to subobjects which were initialized earlier.
|
||||
static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, const LValue &This,
|
||||
const Expr *E, bool AllowNonLiteralTypes) {
|
||||
if (E->isTypeDependent() || E->isValueDependent())
|
||||
return false;
|
||||
if (!AllowNonLiteralTypes && !CheckLiteralType(Info, E, &This))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -133,3 +133,11 @@ namespace test4 {
|
|||
// equivalent to "const int x = 42;" as per C++03 8.5/p13.
|
||||
typedef A<i> Ai; // ok
|
||||
}
|
||||
|
||||
// rdar://16064952
|
||||
namespace rdar16064952 {
|
||||
template < typename T > void fn1() {
|
||||
T b;
|
||||
unsigned w = ({int a = b.val[sizeof(0)]; 0; }); // expected-warning {{use of GNU statement expression extension}}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue