[LLVMbugs] [Bug 18867] New: "Cannot combine with previous '(error)' declaration" on template error with "final"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Feb 17 04:27:17 PST 2014


            Bug ID: 18867
           Summary: "Cannot combine with previous '(error)' declaration"
                    on template error with "final"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following (incorrect) code results in a weird diagnostic when compiled with
clang r201505:

template <typename V>
struct Foo {};

template <typename V>
struct Foo<V, N> final {};

This results in:

% ~/LLVM/build/Release+Asserts/bin/clang++ -std=c++11 clang.cpp
clang.cpp:5:15: error: use of undeclared identifier 'N'
struct Foo<V, N> final {};
clang.cpp:5:1: error: cannot combine with previous '(error)' declaration
struct Foo<V, N> final {};
2 errors generated.

The first diagnostic is correct, as <N> hasn't been defined anywhere. The
second however doesn't make much sense.

Removing <final> from the (incorrect) partial template specialization makes the
second diagnostic go away.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140217/cf7dc82d/attachment.html>

More information about the llvm-bugs mailing list