-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Given the following two files:
test.hpp:
void bar(int);
template <typename T> void foo(T t) { bar(t); }
test.cpp:
#include "main.hpp"
struct S {};
int main() { foo(S()); }
I do not get any diagnostics when I open test.cpp, even though it does not compile:
In file included from test.cpp:1:
test.hpp:3:39: error: no matching function for call to 'bar'
template <typename T> void foo(T t) { bar(t); }
^~~
test.cpp:5:14: note: in instantiation of function template specialization 'foo<S>' requested here
int main() { foo(S()); }
^
test.hpp:1:6: note: candidate function not viable: no known conversion from 'S' to 'int' for 1st argument
void bar(int);
^
1 error generated.
liginity
Metadata
Metadata
Assignees
Labels
No labels