Skip to content

Instantly share code, notes, and snippets.

@SaitoAtsushi
Created April 4, 2016 16:45
Show Gist options
  • Save SaitoAtsushi/44cca702aed8152f45b7f20cd1787193 to your computer and use it in GitHub Desktop.
Save SaitoAtsushi/44cca702aed8152f45b7f20cd1787193 to your computer and use it in GitHub Desktop.
clang で通るけど gcc でエラーになる
template<class T>
class foo {
friend void T::qux(void);
private:
int baz;
public:
foo(void) : baz(1){}
};
#include <iostream>
class bar {
public:
void qux(void) {
std::cout << data.baz << std::endl;
}
private:
foo<bar> data;
};
int main(void) {
bar x;
x.qux();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment