Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8713

Regression in ROOT: conflict with namespaces and global variables

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.08/06
    • Fix Version/s: 6.10/00, 6.08/08
    • Component/s: Cling, TMVA
    • Labels:
      None
    • Environment:

      Ubuntu 16.04

      Description

      I found a regression in one of our ROOT macros which uses a number of global variables. The script worked fine in 6.06/08.

      Saving the following code,

      Int_t Layer{56};
      Int_t test() { return Layer; }

      as test.C and running it with root test.C results in the following error message

      In file included from input_line_17:1:
      /home/ritter/belle2/software/test.C:2:23: error: reference to 'Layer' is ambiguous
      Int_t test() { return Layer; }
                            ^
      /home/ritter/belle2/software/test.C:1:7: note: candidate found by name lookup is 'Layer'
      Int_t Layer{56};
            ^
      [...]/root/etc/../include/TMVA/NeuralNet.h:676:13: note: candidate found by name lookup is
            'TMVA::DNN::Layer'
            class Layer
                  ^

      I guess the problem is a using namespace TMVA::DNN in the top level of TMVA/MethodDNN.h but I'm curious why this file is included in the first place

        Attachments

          Activity

            People

            • Assignee:
              axel Axel Naumann
              Reporter:
              d0efd835d09c19439b33 Martin Ritter
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: