[LLVMbugs] [Bug 6851] New: Spurious mismatch of out-of-line method definition and method declaration.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 16 02:52:46 PDT 2010


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

           Summary: Spurious mismatch of out-of-line method definition and
                    method declaration.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zaffanella at cs.unipr.it
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following program:

template <bool v>
struct S;

struct N {
  template <bool w>
  S< S<w>::cond && 1 > foo();
};

struct Alien;
bool operator&&(const Alien&, const Alien&);

template <bool w>
S< S<w>::cond && 1 > N::foo() { }


generates a spurious error in clang++ (r101446):

$ llvm/Debug/bin/clang++ -fsyntax-only bug.cc
bug.cc:13:25: error: out-of-line definition of 'foo' does not match any
      declaration in 'N'
S< S<w>::cond && 1 > N::foo() { }
                     ~~~^
1 error generated.

If the declaration of operator&& is commented out, the error disappears.
The same happens if the declaration of operator&& is moved before the
declaration of N or after the definition of N::foo().

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