Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created May 7, 2012 23:41
Show Gist options
  • Save tetsuok/2631466 to your computer and use it in GitHub Desktop.
Save tetsuok/2631466 to your computer and use it in GitHub Desktop.
Code that clang does not allow
// Clang does not compile the code, but gcc does.
// See e.g.,
// http://www.mail-archive.com/llvmbugs@cs.uiuc.edu/msg08044.html
template <typename T>
class Foo {
public:
Foo() {}
~Foo() {}
void func(int a);
};
template <typename T>
void Foo<T>::func(int a = 0) {}
int main() {
Foo<int> foo;
foo.func(1);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment