http://llvm.org/bugs/show_bug.cgi?id=18867
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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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
specifier
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs