[cmake-developers] build error in cmGeneratorExpressionEvaluator.cxx on SunOS CC

Bill Hoffman bill.hoffman at kitware.com
Wed Oct 10 17:02:11 EDT 2012


After this commit: http://open.cdash.org/viewUpdate.php?buildid=2598155
This build error has persisted:

http://open.cdash.org/viewBuildError.php?buildid=2598155

"/export/home/cport/Dashboards/MyTests/CMake/Source/cmGeneratorExpressionEvaluator.cxx", 
line 484: Error: The name reportError(cmGeneratorExpressionContext*, 
const std::basic_string<char, std::char_traits<char>, 
std::allocator<char>>&, const std::basic_string<char, 
std::char_traits<char>, std::allocator<char>>&) is unusable in 
TargetFilesystemArtifact<0, 1, 1, 0>::Evaluate(const 
std::vector<std::basic_string<char, std::char_traits<char>, 
std::allocator<char>>, std::allocator<std::basic_string<char, 
std::char_traits<char>, std::allocator<char>>>>&, 
cmGeneratorExpressionContext*, const GeneratorExpressionContent*, 
cmGeneratorExpressionDAGChecker*) const.
"/export/home/cport/Dashboards/MyTests/CMake/Source


A google shows this:

http://elvis.rowan.edu/studio11_doc/prod/lib/locale/C/LC_MESSAGES/SUNW_SPRO_SC_ccfe.error_help.html

  The name is unusable in a default parameter

The name is unusable as a default parameter in the current context. 
Example of code that generates the error message:

void foo () {
     int a;

     class A {
         public:
             void goo (int b = a) {} // ERROR: a is unusable here
     };
}


So, the compiler thinks that reportError can not be used in 
TargetFilesystemArtifact::Evaluate.   I am guessing the issue is that 
the template might be instatiated in a different scope than the current 
file, so the static reportError will not be available when that happens. 
    Perhaps a namespace for reportError or an inline instead of a static 
would work.


static void reportError(cmGeneratorExpressionContext *context,
                         const std::string &expr, const std::string &result)
{
..

To:

inline void reportError(cmGeneratorExpressionContext *context,
                         const std::string &expr, const std::string &result)
{

Might fix it.


-Bill






More information about the cmake-developers mailing list