[PATCH] D85646: [flang][msvc] Disambiguate injected class name.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 06:11:47 PDT 2020


Meinersbur created this revision.
Meinersbur added reviewers: DavidTruby, sscalpone, isuruf, AlexisPerry, jeanPerier, klausler, tskeith.
Meinersbur added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Meinersbur requested review of this revision.

The identifier `Expr` within the scope of the Expr class (including temple specialization) refers to the current template. The `MapTemplate` template expect a non-instantiated template as the first template argument, not the concrete instantiation of `Expr`. More details at https://en.cppreference.com/w/cpp/language/injected-class-name.

At least msvc iterprets `Expr` as the injected class name, whereas gcc and clang use the global `flang::evalue::Expr` template. Disambiguate by explicitly using the namespace.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85646

Files:
  flang/include/flang/Evaluate/expression.h


Index: flang/include/flang/Evaluate/expression.h
===================================================================
--- flang/include/flang/Evaluate/expression.h
+++ flang/include/flang/Evaluate/expression.h
@@ -745,7 +745,7 @@
   using Result = SomeKind<CAT>;
   EVALUATE_UNION_CLASS_BOILERPLATE(Expr)
   int GetKind() const;
-  common::MapTemplate<Expr, CategoryTypes<CAT>> u;
+  common::MapTemplate<evaluate::Expr, CategoryTypes<CAT>> u;
 };
 
 template <> class Expr<SomeCharacter> : public ExpressionBase<SomeCharacter> {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85646.284334.patch
Type: text/x-patch
Size: 528 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200810/11ac686c/attachment.bin>


More information about the llvm-commits mailing list