Skip to content

Commit

Permalink
Try to make GCC5 happy about the CfgTraits thing
Browse files Browse the repository at this point in the history
It was failing with:

In file included from /work/llvm.monorepo/clang/lib/Analysis/Dominators.cpp:9:0:
/work/llvm.monorepo/clang/include/clang/Analysis/Analyses/Dominators.h: At global scope:
/work/llvm.monorepo/clang/include/clang/Analysis/Analyses/Dominators.h:111:26:
error: specialization of ‘template<class CfgRelatedTypeT> struct llvm::CfgTraitsFor’ in different namespace [-fpermissive]
 template <> struct llvm::CfgTraitsFor<clang::CFGBlock> {
                          ^
In file included from /work/llvm.monorepo/clang/include/clang/Analysis/Analyses/Dominators.h:21:0,
                 from /work/llvm.monorepo/clang/lib/Analysis/Dominators.cpp:9:
/work/llvm.monorepo/llvm/include/llvm/Support/CfgTraits.h:294:44:
error:   from definition of ‘template<class CfgRelatedTypeT> struct llvm::CfgTraitsFor’ [-fpermissive]
 template <typename CfgRelatedTypeT> struct CfgTraitsFor;
                                            ^
  • Loading branch information
zmodem committed Oct 20, 2020
1 parent 234c47a commit 03a5f7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clang/include/clang/Analysis/Analyses/Dominators.h
Expand Up @@ -108,15 +108,16 @@ class CfgTraits : public llvm::CfgTraits<CfgTraitsBase, CfgTraits> {

} // namespace clang

template <> struct llvm::CfgTraitsFor<clang::CFGBlock> {
namespace llvm {

template <> struct CfgTraitsFor<clang::CFGBlock> {
using CfgTraits = clang::CfgTraits;
};

// FIXME: There is no good reason for the domtree to require a print method
// which accepts an LLVM Module, so remove this (and the method's argument that
// needs it) when that is fixed.

namespace llvm {

class Module;

Expand Down

0 comments on commit 03a5f7c

Please sign in to comment.