[Mlir-commits] [mlir] 1c941d9 - [mlir] Fix gcc -std=c++17 compilation.

Michael Kruse llvmlistbot at llvm.org
Thu Mar 3 07:16:32 PST 2022


Author: Michael Kruse
Date: 2022-03-03T09:03:36-06:00
New Revision: 1c941d98f832002d054f4afcef60d75062226263

URL: https://github.com/llvm/llvm-project/commit/1c941d98f832002d054f4afcef60d75062226263
DIFF: https://github.com/llvm/llvm-project/commit/1c941d98f832002d054f4afcef60d75062226263.diff

LOG: [mlir] Fix gcc -std=c++17 compilation.

Ensure that `Handler` within the class is interpreted as the as the current template instantiation (instead the class template itself).

Fixes #53447

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D120852

Added: 
    

Modified: 
    mlir/include/mlir/Support/DebugAction.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Support/DebugAction.h b/mlir/include/mlir/Support/DebugAction.h
index aa7a820873b3f..82cd08ee72c34 100644
--- a/mlir/include/mlir/Support/DebugAction.h
+++ b/mlir/include/mlir/Support/DebugAction.h
@@ -193,7 +193,8 @@ template <typename... ParameterTs> class DebugAction {
 public:
   class Handler : public DebugActionManager::HandlerBase {
   public:
-    Handler() : HandlerBase(TypeID::get<Handler>()) {}
+    Handler()
+        : HandlerBase(TypeID::get<DebugAction<ParameterTs...>::Handler>()) {}
 
     /// This hook allows for controlling whether an action should execute or
     /// not. `parameters` correspond to the set of values provided by the
@@ -205,7 +206,8 @@ template <typename... ParameterTs> class DebugAction {
 
     /// Provide classof to allow casting between handler types.
     static bool classof(const DebugActionManager::HandlerBase *handler) {
-      return handler->getHandlerID() == TypeID::get<Handler>();
+      return handler->getHandlerID() ==
+             TypeID::get<DebugAction<ParameterTs...>::Handler>();
     }
   };
 


        


More information about the Mlir-commits mailing list