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

           Summary: Difference between clang and g++ in lookup of methods
                    of template base classes
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
            Blocks: 6023


The folowing code compiles fine with g++, clang++ wants fooNum to be qualified
(Foo<T>::fooNum). I'm not sure which compiler handles this case correctly, but
this affects boost (a similar construct is used in the OpenSSL backend of the
Boost ASIO library).


template <typename T>
struct Foo {
  void fooNum(int newNum) {}
};

template <typename T>
struct Bar : public Foo<T> {
  Bar(int i) { 
    fooNum(getNum());
  }

  int getNum() {return 23;}
};

int main() {
  Bar<void> bar(42);

  return 0;
}


g++ does find the fooNum method, as it considers getNum dependent on T, so it
also looks in Foo. Just calling 'fooNum(23);' fails with both compilers.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to