[LLVMbugs] [Bug 17664] New: clang fails with 'has internal linkage but is not defined'
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Oct 23 09:11:19 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=17664
Bug ID: 17664
Summary: clang fails with 'has internal linkage but is not
defined'
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: ppadevski at gmail.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Cannot compile the following code:
// Adaptee.h
class Adaptee { };
// Adapter.h
class Adapter {
template<typename T>
class Method {
static void Get(const T *);
}
template<typename T>
static void Adapt(const T *v) {
Method<T>::Get(v);
}
};
// Adaptee.cpp
#include <Adaptee.h>
#include <Adapter.h>
template<>
void Adapter::Method<Adaptee>::Get(const Adaptee *) { }
// main.cpp
#include <Adaptee.h>
#include <Adapter.h>
int
main()
{
Adaptee a;
Adapter::Adapt(&a);
}
The error occurs when compiling main.cpp:
'Adapter::Adapt<Adaptee>::Get' has internal linkage but is not defined
[-Werror,-Wundefined-internal]
static void Get(const T *nv);
^
Adapter.h:10: note: used here
Method<T>::Get(v);
This used to work on previous clang releases and on any gcc and vc. Is there a
known workaround?
--
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/20131023/3db86005/attachment.html>
More information about the llvm-bugs
mailing list