I was wondering if the following clang behavior is expected/standard compliant:
1. non-template friend function (not constructor): compiles in gcc and clang
2. non-template friend constructor: compiles in gcc and clang
3. template friend function (not constructor): compiles in gcc and clang
4. template friend constructor: compiles in gcc , but not clang
(compiled in clang 3.0.0 but not clang 3.1+)
Here is an example (use -DUSE_TEMPLATE to control whether the template
or non-template code is compiled):
In the clang case for (4), it gives an error as if the friend
declaration was never made.
Looking at a C++ standard:
It looks like section 14.3.5 gives an explicit example of a
non-template friend constructor being allowed. In 17.5.4, it didn't
look like there was anything to indicate template friend constructors
are treated different than template friend non-constructor functions,
but maybe I'm missing a subtle point in that section or elsewhere.