[clang] 03a5f7c - Try to make GCC5 happy about the CfgTraits thing
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 08:19:17 PDT 2020
Author: Hans Wennborg
Date: 2020-10-20T17:18:42+02:00
New Revision: 03a5f7ce12e2111c8b7bc5a95cff4c51b516250f
URL: https://github.com/llvm/llvm-project/commit/03a5f7ce12e2111c8b7bc5a95cff4c51b516250f
DIFF: https://github.com/llvm/llvm-project/commit/03a5f7ce12e2111c8b7bc5a95cff4c51b516250f.diff
LOG: Try to make GCC5 happy about the CfgTraits thing
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;
^
Added:
Modified:
clang/include/clang/Analysis/Analyses/Dominators.h
Removed:
################################################################################
diff --git a/clang/include/clang/Analysis/Analyses/Dominators.h b/clang/include/clang/Analysis/Analyses/Dominators.h
index e09ff04fa95a..367f135a98ec 100644
--- a/clang/include/clang/Analysis/Analyses/Dominators.h
+++ b/clang/include/clang/Analysis/Analyses/Dominators.h
@@ -108,7 +108,9 @@ 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;
};
@@ -116,7 +118,6 @@ template <> struct llvm::CfgTraitsFor<clang::CFGBlock> {
// which accepts an LLVM Module, so remove this (and the method's argument that
// needs it) when that is fixed.
-namespace llvm {
class Module;
More information about the cfe-commits
mailing list