[LLVMbugs] [Bug 6830] New: Clang complains the qualified class name in a constructor call doesn't refer to a value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 13 13:43:30 PDT 2010


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

           Summary: Clang complains the qualified class name in a
                    constructor call doesn't refer to a value
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zhanyong.wan at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


$ cat t.cc
namespace foo {

class X {
 public:
  X() {}
};

}  // namespace foo

class Z {
 public:
  explicit Z(const foo::X& x) {}

  void Work() {}
};

void Test() {
  Z(foo::X()).Work();
}

$ clang -c t.cc
t.cc:18:10: error: 'X' does not refer to a value
  Z(foo::X()).Work();
    ~~~~~^
t.cc:3:7: note: declared at
class X {
      ^
2 diagnostics generated.

The error goes away if we move X out of namespace 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