http://llvm.org/bugs/show_bug.cgi?id=17509
Bug ID: 17509
Summary: a call matches incorrect a template function
Product: clang
Version: unspecified
Hardware: Macintosh
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
clang-500.2.75
//============================================================================
// Name : template.h
template<typename T>
long Print(const T& v) {
return sizeof(T);
}
//============================================================================
// Name : sizeofbug.cpp
#include "template.h"
#include <stdio.h>
struct Test {
bool value;
};
void TestFunc();
int main() {
fprintf(stderr, "main.cpp: Test: %d %ld\n", sizeof(Test), Print(Test()));
TestFunc();
return 0;
}
//============================================================================
// Name : source.cpp
#include "template.h"
#include <stdio.h>
struct Test {
bool value;
bool value2;
};
void TestFunc() {
fprintf(stderr, "source.cpp: Test: %d %ld\n", sizeof(Test), Print(Test()));
}
Output:
main.cpp: Test: 1 1
source.cpp: Test: 2 1
--
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