Skip to content

Commit 99a1457

Browse files
committed
Don't evaluate dependent variables
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent 5c8e598 commit 99a1457

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/CppParser/Parser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3707,7 +3707,8 @@ AST::ExpressionObsolete* Parser::WalkVariableInitializerExpression(const clang::
37073707
return WalkExpressionObsolete(Expr);
37083708

37093709
clang::Expr::EvalResult result;
3710-
if (Expr->EvaluateAsConstantExpr(result, c->getASTContext()))
3710+
if (!Expr->isValueDependent() &&
3711+
Expr->EvaluateAsConstantExpr(result, c->getASTContext()))
37113712
{
37123713
std::string s;
37133714
llvm::raw_string_ostream out(s);

tests/Common/Common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,6 +1535,9 @@ class QScopedPointer
15351535
}
15361536
};
15371537

1538+
template <typename T>
1539+
struct dependentVariable { static const size_t var = alignof(T); };
1540+
15381541
class QObjectData {
15391542
};
15401543

0 commit comments

Comments
 (0)