[LLVMbugs] [Bug 12931] New: incorrect overload resolution

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 23 19:04:02 PDT 2012


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

             Bug #: 12931
           Summary: incorrect overload resolution
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: roman at binarylife.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The compiler should instantiate doit(junk ...) in the test below.

$ cat test.C
struct junk {
  template<typename X>
  junk(X const volatile&);
};

template<typename X>
struct tester {
  static void doit(junk ...);
  static void doit(X,int);
};

enum enum_type { ev };

void foo(enum_type& enum_value) {
  tester<int const volatile&>::doit(enum_value,0);
}

$ clang++ -c test.C
test.C:15:37: error: volatile lvalue reference to type 'const volatile int'
cannot bind to a value of unrelated type 'enum_type'
  tester<int const volatile&>::doit(enum_value,0);
                                    ^~~~~~~~~~
test.C:9:21: note: passing argument to parameter here
  static void doit(X,int);
                    ^
1 error generated.

$ clang++ --version
clang version 3.1 (branches/release_31 157338)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
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.



More information about the llvm-bugs mailing list