From 0bf54add8e11edb1adf833a3857f6449d1135d0b Mon Sep 17 00:00:00 2001
From: Felix Gruber <gruber@igpm.rwth-aachen.de>
Date: Tue, 8 May 2018 13:53:15 +0200
Subject: [PATCH] fix -Winjected-class-name warnings in Clang

When compiling with Clang 5.0.1 one gets two warnings about nested type
specifiers that were probably not intended to be there in the first
place. The first one is asking a *_t type trait for ::type and the
second one is asking for Entity::Entity.

The exact warnings given by Clang were:

/duneci/modules/dune-subgrid/dune/subgrid/common/variant.hh:31:66: warning: ISO C++ specifies that qualified reference to 'type' is a constructor name rather than a type in this context, despite preceding 'typename' keyword [-Winjected-class-name]
    using Storage = typename std::aligned_storage_t<sizeof(Tp)>::type;
                                                                 ^

/duneci/modules/dune-subgrid/dune/subgrid/subgrid.hh:1190:67: warning: ISO C++ specifies that qualified reference to 'Entity' is a constructor name rather than a type in this context, despite preceding 'typename' keyword [-Winjected-class-name]
            typedef typename HostGrid::template Codim<0>::Entity::Entity HostGridElement;
                                                                  ^
---
 dune/subgrid/common/variant.hh | 2 +-
 dune/subgrid/subgrid.hh        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dune/subgrid/common/variant.hh b/dune/subgrid/common/variant.hh
index 8e54786..05a6ea4 100644
--- a/dune/subgrid/common/variant.hh
+++ b/dune/subgrid/common/variant.hh
@@ -28,7 +28,7 @@ namespace Impl {
 
   template<typename Tp>
   struct Buffer_ : std::aligned_storage<sizeof(Tp)> {
-    using Storage = typename std::aligned_storage_t<sizeof(Tp)>::type;
+    using Storage = std::aligned_storage_t<sizeof(Tp)>;
     Storage storage_;
 
     void* addr() {
diff --git a/dune/subgrid/subgrid.hh b/dune/subgrid/subgrid.hh
index eed412f..d979b9d 100644
--- a/dune/subgrid/subgrid.hh
+++ b/dune/subgrid/subgrid.hh
@@ -1187,7 +1187,7 @@ class SubGrid :
         template<class ElementTransfer>
         void transfer(ElementTransfer& elementTransfer) const
         {
-            typedef typename HostGrid::template Codim<0>::Entity::Entity HostGridElement;
+            typedef typename HostGrid::template Codim<0>::Entity HostGridElement;
 
             int hostMaxLevel = hostgrid_->maxLevel();
 
-- 
GitLab