[LLVMbugs] [Bug 20786] New: error merging operator== from different modules

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 28 02:04:01 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20786

            Bug ID: 20786
           Summary: error merging operator== from different modules
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: biancacristinacristescu at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat module_TreePlayer.map 
module libMathCore {
  header "TMath.h"
  header "TVirtualFitter.h"  
}

module libHist { 
  header "TFormula.h"
  header "TFractionFitter.h"
}

module libTreePlayer {
  header "TBranchProxy.h"
  header "TTreeFormula.h"
}
--------------------------------------------------------------------------------
$ cat TMath.h
#include "random.h"
--------------------------------------------------------------------------------
$ cat TVirtualFitter.h //yes, empty
$ 
--------------------------------------------------------------------------------
$ cat TFormula.h 
class TFormula  {};
--------------------------------------------------------------------------------
 $ cat TFractionFitter.h 
# include "TVirtualFitter.h"
--------------------------------------------------------------------------------
$ cat TBranchProxy.h 
#include "random.h"
--------------------------------------------------------------------------------
$ cat TTreeFormula.h 
#include "TFormula.h"
class TTreeFormula : public TFormula {};
--------------------------------------------------------------------------------
$ cat random.h 
namespace std 
{
  template<typename _UIntType, unsigned int __w,
       unsigned int __n, unsigned int __m, unsigned int __r,
       _UIntType __a, unsigned int __u, _UIntType __d, unsigned int __s,
       _UIntType __b, unsigned int __t,
       _UIntType __c, unsigned int __l, _UIntType __f>
    class mersenne_twister_engine
    {
    public:

      friend bool
      operator==(const mersenne_twister_engine& __lhs,
         const mersenne_twister_engine& __rhs)
      { return 0; }

    };

  typedef mersenne_twister_engine<
    unsigned int,
    32, 624, 397, 31,
    0x9908b0dfUL, 11,
    0xffffffffUL, 7,
    0x9d2c5680UL, 15,
    0xefc60000UL, 18, 1812433253UL> mt19937;


  class random_device
  {
      mt19937      _M_mt;
  };
} // namespace std
--------------------------------------------------------------------------------

Command run and error generated is:
"/usr/inst-deb-clang/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -E
-disable-free -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -target-linker-version 2.24 -v -dwarf-column-info
-resource-dir /usr/inst-deb-clang/bin/../lib/clang/3.6.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem /usr/local/include -internal-isystem
/usr/inst-deb-clang/bin/../lib/clang/3.6.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/cristina/clang-bugs/clang-tiered-pcm-reproducer
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -x c++
-fcolor-diagnostics -x c++ -std=c++11
-I/home/cristina/root/objClangBugs/include   -fmodules
-fno-modules-global-index -fdisable-module-hash -fmodule-maps -emit-module
/home/cristina/root/objClangBugs/include/module_TreePlayer.map
-fmodules-cache-path=/home/cristina/clang-bugs/clang-tiered-pcm-reproducer/pcm
-fmodule-name=libTreePlayer
clang -cc1 version 3.6.0 based upon LLVM 3.6.0svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/cristina/root/objClangBugs/include
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
 /usr/local/include
 /usr/inst-deb-clang/bin/../lib/clang/3.6.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
clang -cc1 version 3.6.0 based upon LLVM 3.6.0svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/cristina/root/objClangBugs/include
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
 /usr/local/include
 /usr/inst-deb-clang/bin/../lib/clang/3.6.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
clang -cc1 version 3.6.0 based upon LLVM 3.6.0svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/x86_64-linux-gnu"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/cristina/root/objClangBugs/include
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
 /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
 /usr/local/include
 /usr/inst-deb-clang/bin/../lib/clang/3.6.0/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
In module 'libHist' imported from
/home/cristina/root/objClangBugs/include/TTreeFormula.h:1:
In module 'libMathCore' imported from
/home/cristina/root/objClangBugs/include/TFractionFitter.h:1:
/home/cristina/root/objClangBugs/include/random.h:13:7: error:
'std::operator==' from module 'libMathCore' is not present in definition of
namespace 'std' in module 'libMathCore'
      operator==(const mersenne_twister_engine& __lhs,
      ^
/home/cristina/root/objClangBugs/include/random.h:1:11: note: definition has no
member 'operator=='
namespace std 
          ^
1 error generated.
-------------------------------------------------------------------------------

I have seen this error in more than this case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140828/ceebff18/attachment.html>


More information about the llvm-bugs mailing list