[cfe-commits] r123217 - in /cfe/trunk: include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h include/clang/StaticAnalyzer/PathSensitive/ExprEngine.h include/clang/StaticAnalyzer/PathSensitive/SubEngine.h lib/StaticAnalyzer/Checkers/ExprEngine.cpp lib/StaticAnalyzer/CoreEngine.cpp test/Analysis/retain-release-region-store.m

Benoit Perrot benoit at lrde.epita.fr
Tue Jan 11 01:46:10 PST 2011


Hello,

Please note that r123217 broke the compilation with MSVC 9.0 compiler.
The introduction of "GenericNodeBuilder<PP>" in the namespace "clang::ento"
("include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h") led to an
ambiguity with "GenericNodeBuilder" declared and defined in
"lib/StaticAnalyzer/CFRefCount.cpp" - where the namespace "clang::ento"
is used globally:

./CFRefCount.cpp(3142) : error C2872: 'GenericNodeBuilder' : ambiguous symbol
         could be './CFRefCount.cpp(94) :  
`anonymous-namespace'::GenericNodeBuilder'
         or        
'include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h(432) :  
clang::ento::GenericNodeBuilder'
./CFRefCount.cpp(3227) : error C2872: 'GenericNodeBuilder' : ambiguous symbol
         could be './CFRefCount.cpp(94) :  
`anonymous-namespace'::GenericNodeBuilder'
         or        
'include/clang/StaticAnalyzer/PathSensitive/CoreEngine.h(432) :  
clang::ento::GenericNodeBuilder'

To be more precise, the following snippet does not compile with
MSVC9.0, for the same reason ("`anonymous-namespace'::A" conflicts
with "n::A" whose namespace "n" is used globally):

namespace n {
   struct A {
   };
}

using namespace n;

namespace {
   struct A {
   };
}

namespace {
   struct B {
     void foo(A &a) { // A: ambiguous symbol
     }

   };
}

int
main()
{
   B b;
   A a;
   b.foo(a)
   return 0;
}


Removing the "using namespace ento" directive in
"lib/StaticAnalyzer/CFRefCount.cpp" and prepending "ento::"
where appropriated, solves the problem.

... Renaming one of the two GenericNodeBuilder and updating
accordingly would work too :)

-- 
Benoit PERROT

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.





More information about the cfe-commits mailing list