[cfe-dev] CheckerRegistry.h + Version.h = clang::ento::clang ??

Jordan Rose jordan_rose at apple.com
Tue Aug 27 10:02:31 PDT 2013


Fixed in r189370.


On Aug 26, 2013, at 9:18 , Jordan Rose <jordan_rose at apple.com> wrote:

> No, this is not intentional. Thanks for the report!
> 
> 
> On Aug 26, 2013, at 7:11 , Gábor Kozár <kozargabor at gmail.com> wrote:
> 
>> Hi,
>> 
>> I ran into an interesting problem today while using Clang 3.3. I managed to reproduce the problem with this minimal test file:
>> 
>> #include "clang/StaticAnalyzer/Core/CheckerRegistry.h"
>> 
>> using namespace clang::ento;
>> 
>> using namespace clang; // ::clang or ::clang::ento::clang??
>> 
>> To which GCC 4.7.2 says:
>> 
>> test.cpp:5:17: error: reference to ‘clang’ is ambiguous
>> In file included from .../include/clang/StaticAnalyzer/Core/CheckerRegistry.h:13:0,
>>                 from test.cpp:1:
>> .../include/clang/Basic/LLVM.h:52:17: error: candidates are: namespace clang { }
>> In file included from .../include/clang/StaticAnalyzer/Core/CheckerRegistry.h:66:0,
>>                 from test.cpp:1:
>> .../include/clang/Basic/Version.h:42:17: error:                 namespace clang::ento::clang { }
>> 
>> Looking at CheckerRegistry.h and Version.h, it is evident what the problem is: CheckerRegistry.h includes Version.h while already inside the clang::ento namespace, and Version.h also starts a clang namespace, whose full name will thus be ::clang::ento::clang.
>> 
>> Is this intentional? I do not see any comments in the source code about this.
>> Of course it is easily fixed on the user side by referring to "::clang" instead of just "clang", but I'm still curious.
>> 
>> Thanks!
>> 
>> Gabor
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 





More information about the cfe-dev mailing list