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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs