[mlir][DeclarativeParser][NFC] Use explicit type names in TypeSwitch to
authorRiver Riddle <riddleriver@gmail.com>
Sat, 22 Feb 2020 00:09:58 +0000 (16:09 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Sat, 22 Feb 2020 00:14:13 +0000 (16:14 -0800)
appease older GCC.

Older versions of GCC are unable to properly capture 'this' in template lambdas,
resulting in errors.

mlir/tools/mlir-tblgen/OpFormatGen.cpp

index 3655bf7..17c8519 100644 (file)
@@ -1684,7 +1684,7 @@ LogicalResult FormatParser::parseOptionalChildElement(
       })
       // Only optional-like(i.e. variadic) operands can be within an optional
       // group.
-      .Case<OperandVariable>([&](auto *ele) {
+      .Case<OperandVariable>([&](OperandVariable *ele) {
         if (!ele->getVar()->isVariadic())
           return emitError(childLoc, "only variadic operands can be used within"
                                      " an optional group");
@@ -1694,13 +1694,13 @@ LogicalResult FormatParser::parseOptionalChildElement(
       // Literals and type directives may be used, but they can't anchor the
       // group.
       .Case<LiteralElement, TypeDirective, FunctionalTypeDirective>(
-          [&](auto *) {
+          [&](Element *) {
             if (isAnchor)
               return emitError(childLoc, "only variables can be used to anchor "
                                          "an optional group");
             return success();
           })
-      .Default([&](auto *) {
+      .Default([&](Element *) {
         return emitError(childLoc, "only literals, types, and variables can be "
                                    "used within an optional group");
       });