[LLVMbugs] [Bug 8065] New: false positive warning due to template meta-programming

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 2 15:41:42 PDT 2010


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

           Summary: false positive warning due to template
                    meta-programming
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5446)
 --> (http://llvm.org/bugs/attachment.cgi?id=5446)
testcase

I'm getting the warning "conversion function converting ... to itself will
never be used" in a case where our class has a conversion function to template
parameter T which happens to be itself in this case but not in others. The
warning should be suppressed when that happens.

nlewycky at ducttape:~$ g++ -Wall -pedantic -fsyntax-only b2971306.cc
nlewycky at ducttape:~$ clang++ -Wall -pedantic -fsyntax-only b2971306.cc
b2971306.cc:12:3: warning: conversion function converting 'Container<int>' to
      itself will never be used
  operator X(void) { return X(); }
  ^
b2971306.cc:15:16: note: in instantiation of template class 'Container<int>'
      requested here
Container<int> test;
               ^
1 warning generated.

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