Files
compiler-explorer/test/cases/vc-main-opt-out-example.cpp
T
Nicole Mazzuca 9ddf22f090 Support Visual C++ and Windows well
This commit adds support for hosting on windows, as well as better
support for the Visual C++ compiler. Specific interesting changes are:

  - switch from /FAsc to /FA
  - order functions in file order
  - support demangling win32-style identifiers with undname
  - clang++ and vc++ on win32 host are both supported
2018-07-28 15:18:43 -07:00

15 lines
383 B
C++
Generated

// compile flags:
// [amd64] cl /FA /EHsc /c vc-main-opt-out-example.cpp /FAvc-main-opt-out.asm
// then, replace the filename for <array> with std\array
#include <array>
template <int... vars>
constexpr auto make_array() {
return std::array<int, sizeof...(vars)>{vars...};
}
int main() {
constexpr auto a = make_array<1, 3, 4, 2, 3, 5, 6, 4, 8, 9, 2>();
return a[2];
}