https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48518

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
FWIW GCC changed with r153958:

  re PR c++/34870 (argument-dependent lookup fails to find friend declaration)

          PR c++/34870
          * name-lookup.c (arg_assoc_class): Call complete_type.
          * pt.c (instantiate_class_template): Call uses_template_parms
          instead of dependent_type_p.

Clang 3.0.0 accepted it, 3.1 rejects it, so probably due to either
https://github.com/llvm/llvm-project/commit/fd555f6b1fd950eff620e74da887dc37d919a276
or
https://github.com/llvm/llvm-project/commit/e06a2c1893a64c50e2f0d9d0ad35a7d6bd639f93

The new behaviour is correct, the statement 'return *content_;' wants to look
inside associated classes (which includes template arguments) to see if there
is an overloaded operator* that should be found by ADL. The test_works.ii and
comment 2 versions do not do ADL for operator* because content_.get() and
content_.operator*() are only looked up in the scope of content_'s type, not in
associated classes.

Reply via email to