From be02d3f0f2689475f31c4523010eed58f39d27cb Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 18 Oct 2021 16:57:12 -0700 Subject: Update to C++17 and use std::optional for getSuperType (#4203) This sets the C++ standard variable in the build to C++17, and makes use of std::optional (a C++17 library feature) in one place, to test that it's working. --- src/passes/Print.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 96a1abe73..34fe92ff6 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2515,9 +2515,8 @@ struct PrintSExpression : public UnifiedExpressionVisitor { } // Module-level visitors void printSupertypeOr(HeapType curr, std::string noSuper) { - HeapType super; - if (curr.getSuperType(super)) { - TypeNamePrinter(o, currModule).print(super); + if (auto super = curr.getSuperType()) { + TypeNamePrinter(o, currModule).print(*super); } else { o << noSuper; } -- cgit v1.2.3