Workaround for EvalInfo ctor for MSVC 2017
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 26 Nov 2019 18:13:47 +0000 (13:13 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 27 Nov 2019 02:43:29 +0000 (21:43 -0500)
commitded249049429a26d3748926c04bd7169f0170714
tree594f6b7e702ab02b2d360ad662bae81c94c8ff6b
parent350565dbc06d32096ae3ade7bc3d2e58ac654273
Workaround for EvalInfo ctor for MSVC 2017

Current EvalInfo ctor causes EnableNewConstInterp to be true even though
it is supposed to be false on MSVC 2017. This is because a virtual function
getLangOpts() is called in member initializer lists, whereas on MSVC
member ctors are called before function virtual function pointers are
initialized.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D70729
clang/lib/AST/ExprConstant.cpp
clang/test/Sema/eval-info.c [new file with mode: 0644]