[LLVMbugs] [Bug 23303] New: this Template code might not output error message
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Apr 21 08:45:52 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23303
Bug ID: 23303
Summary: this Template code might not output error message
Product: clang
Version: 3.5
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: kunling at lingcc.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
The code comes from stackoverflow http://stackoverflow.com/q/29776850/566459
// Forward declaration:
template <class S, class T>
struct Base;
template <class T>
struct BaseFriend {
friend struct Base<int, T>;
};
// Actual declaration:
template <class S, class T = int>
struct Base {
void foo() {}
};
struct DerivedFriend : BaseFriend<int> {};
struct Derived : Base<int> {
void foo(int) {
Base<int>::foo();
}
};
G++ could successfully compile it, while using clang++ 3.6, it gives the
following error message:
error: too few template arguments for class template 'Base'
Base<int>::foo();
^
test.cpp:3:8: note: template is declared here
struct Base;
^
--
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/20150421/8543bb3e/attachment.html>
More information about the llvm-bugs
mailing list