title: Inherited member function seems undeclared, what is going on?
body: <p>I would like to compile a C++ software which gives me a couple of compilation
  errors. This error is about a member function that cannot be resolved.</p>
  
  <p>This question should contain everything needed to answer it. However, if that
  really was the case, I should have found the answer by now. So please feel free
  to browse the <a href="https://github.com/martin-ueding/bfm/tree/fee0a02554073434f3f8a54304580e47ee834e61/bfm" rel="nofollow noreferrer">source
  code</a>.
  All code in this question is not mine but licensed under the GPLv2.</p>
  
  <p>The system I compile on is an IBM PowerPC 740 running Red Hat Enterprise Server
  6.8. Using modules, I have enabled Clang 3.7. Everything gets cross-compiled
  for IBM PowerPC A2 chips, it is an IBM BlueGene/Q supercomputer. Those things
  should be taken care by my <a href="https://github.com/martin-ueding/chroma-auxiliary-scripts/blob/014c9e823a96d492b325a2aaf743038413dc1152/compilation/bootstrap-chroma-juqueen.sh#L243" rel="nofollow noreferrer">compilation
  script</a>
  that sets the many <code>configure</code> and <code>CXXFLAGS</code> needed.</p>
  
  <p>The compilation error that I currently get with the my current state (commit
  <code>fee0a02</code>) is this one:</p>
  
  <pre><code>bfmcommqmp.C:183:5: error: use of undeclared identifier 'gather'
      gather(result_cb, psi, dag);
      ^
  </code></pre>
  
  <p>The offending line is in this method definition in <code>bfmcommqmp.C</code>:</p>
  
  <pre><code>168 template &lt;class Float&gt;                                                          
  169 void bfmcommQMP&lt;Float&gt;::comm_start(int result_cb, Fermion_t psi, int dag) {     
  170     // gather the faces. Routines here are threaded.                            
  171     // All threads cooperate in gathering.                                      
  172                                                                                 
  173     //  if ( this-&gt;isBoss() &amp;&amp; (me == 0)) {                                     
  174     //    this-&gt;Error("comm_start checking heap\n"); fflush(stdout);            
  175     //    mcheck_check_all();                                                   
  176     //    this-&gt;Error("comm_start mcheck_all");fflush(stdout);                  
  177     //  }                                                                       
  178                                                                                 
  179     int me = this-&gt;thread_barrier();                                            
  180                                                                                 
  181     this-&gt;thread_barrier();                                                     
  182                                                                                 
  183     gather(result_cb, psi, dag);                                                
  184                                                                                 
  185     this-&gt;thread_barrier();                                                     
  186     if (me == 0) {                                                              
  187         comm_qmp_start(psi);                                                    
  188     }                                                                           
  189     this-&gt;thread_barrier();                                                     
  190                                                                                 
  191     return;                                                                     
  192 }
  </code></pre>
  
  <p>This is of course part of the <code>bfmcommQMP</code> class. Looking at the associated
  header file, <code>bfmcommqmp.h</code>, one finds this class declaration:</p>
  
  <pre><code>  8 template &lt;class Float&gt;                                                          
    9 class bfmcommQMP : public bfmbase&lt;Float&gt; {                                      
   10   public:                                                                       
   11     // QMP thingy-me-bob's                                                      
   12     QMP_msghandle_t multi_handle[2];                                            
   13                                                                                 
   14     QMP_msgmem_t send_ops_msgmem_t[8];                                          
   15     QMP_msgmem_t recv_ops_msgmem_t[8];                                          
   16                                                                                 
   17     QMP_msghandle_t send_multi_handle;                                          
   18     QMP_msghandle_t send_handles[8];                                            
   19                                                                                 
   20     QMP_msghandle_t recv_handles[8];                                            
   21     QMP_msghandle_t all_handles;                                                
   22                                                                                 
   23     Float *simd_rbuf[8];                                                        
   24     Float *receive_area;                                                        
   25                                                                                 
   26     int num_op;                                                                 
   27                                                                                 
   28     virtual bool isBoss();                                                      
   29                                                                                 
   30     virtual void recv_init(void);                                               
   31     virtual void recv_end(void);                                                
   32                                                                                 
   33     virtual void comm_init(void);                                               
   34     virtual void comm_end(void);                                                
   35     virtual void comm(int result_cb, Fermion_t psi, int dag);                   
   36     virtual void comm_start(int result_cb, Fermion_t psi, int dag);             
   37     virtual void comm_qmp_start(Fermion_t psi);                                 
   38     virtual void comm_qmp_complete(void);                                       
   39     virtual void comm_merge(void);                                              
   40     virtual void comm_complete(int result_cb, Fermion_t psi);                   
   41     virtual void comm_gsum(double &amp;val);                                        
   42     virtual void comm_gsum(double *val, int N);                                 
   43 };
  </code></pre>
  
  <p>It inherits from <code>bfmbase</code>. Jumping to the file <code>bfm.h</code> which is included in
  <code>bfmcommqmp.h</code>, we find the class definition, which contains two <code>gather</code>
  methods:</p>
  
  <pre><code> 133 template &lt;class Float&gt;                                                          
   134 class bfmbase : public bfmarg, public ThreadModel {                             
   135   public:  
  
   282     void gather(int result_cb, Fermion_t psi, int dag);
   283     void gather(int mu, int result_cb, Fermion_t psi, int dag); 
  
  1018 };
  </code></pre>
  
  <p>From my understanding, the class <code>bfmcommQMP</code> should have inherited the
  non-virtual function <code>gather</code> from <code>bfmbase</code>. Apparently that is not the case,
  otherwise Clang would not complain about that.</p>
  
  <p>What am I missing here? Why is the function <code>gather</code> not available inside the
  <code>bfmcommQMP::comm_start</code> member function?</p>