[LLVMbugs] [Bug 12940] New: redundant error when redefining a function as deleted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 24 13:33:43 PDT 2012


             Bug #: 12940
           Summary: redundant error when redefining a function as deleted
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: ASSIGNED
          Keywords: quality-of-implementation
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: dblaikie at gmail.com
        ReportedBy: dblaikie at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


  void func() { }
  void func() = delete;

Clang produces:

  spec.cpp:2:6: error: redefinition of 'func'
  void func() = delete;
  spec.cpp:1:6: note: previous definition is here
  void func() { }
  spec.cpp:2:15: error: deleted definition must be first declaration
  void func() = delete;
  spec.cpp:1:6: note: previous declaration is here
  void func() { }

Essentially the same diagnostic twice. Either we could simply suppress the
second diagnostic when we know the function is already defined (& thus we
already produced the first diagnostic), or suppress the first diagnostic when
the new definition is deleted and, possibly, make the "deleted definition must
be first" diagnostic have some more specific text for this case (based on the
same property as the first option: that there's already a definition)

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