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

Unloading causes misleading error messages when loading a macro twice

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • High
    • Resolution: Unresolved
    • master
    • None
    • Cling
    • None
    • any

    Description

      Originally from this forum post, this is the smallest repro I could make:

      // foo.cpp
      TTreeReader r;
      TTreeReaderValue<int> v = {r, "foo"};
      

      root [0] .L foo.cpp
      root [1] .L foo.cpp // error
      

      In file included from input_line_12:1:
      /tmp/foo.cpp:7:23: error: no matching constructor for initialization of 'TTreeReaderValue<int>'
      TTreeReaderValue<int> v = {r, "foo"};
                            ^   ~~~~~~~~~~
      /home/eguiraud/ROOT/dbg/include/TTreeReaderValue.h:140:30: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument,                    
            but 2 were provided
      class R__CLING_PTRCHECK(off) TTreeReaderValue final: public ROOT::Internal::TT...    
                                   ^
      /home/eguiraud/ROOT/dbg/include/TTreeReaderValue.h:140:30: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument,                    
            but 2 were provided
      /home/eguiraud/ROOT/dbg/include/TTreeReaderValue.h:145:4: note: candidate constructor
      not viable: requires 0 arguments, but 2 were provided                                
         TTreeReaderValue() = delete;
         ^
      

      In more complex scenarios it is very hard to figure out that the problem is that a macro has been loaded twice.

      Attachments

        Activity

          People

            axel Axel Naumann
            eguiraud Enrico Guiraud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: