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

           Summary: Incorrect "initializing multiple members" error, which
                    lacks a SourceLocation
           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]


$ cat test.cc
struct MyStruct {
  union {
    void* ptr_;
    struct { int i_; };
  };

  template <typename T> MyStruct(T) : ptr_(0) { }
};

void f() {
  MyStruct s(3);
}
$ clang++ -fsyntax-only  test.cc
error: initializing multiple members of anonymous union
test.cc:11:12: note: in instantiation of function template specialization
      'MyStruct::MyStruct<int>' requested here
  MyStruct s(3);
           ^
test.cc:7:39: note: previous initialization is here
  template <typename T> MyStruct(T) : ptr_(0) { }
                                      ^~~~~~~
1 error generated.


Note that the error line doesn't have a location, and that only one member is
being initialized.  The error goes away if the MyStruct constructor isn't a
template.

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