llvm-project/clang/test/CXX
Serge Pavlov 79271ab154 Do not inherit default arguments for friend function in class template.
A function declared in a friend declaration may have declarations prior
to the containing class definition. If such declaration defines default
argument, the friend function declaration inherits them. This behavior
causes problems if the class where the friend is declared is a template:
during the class instantiation the friend function looks like if it had
default arguments, so error is triggered.

With this change friend functions declared in class templates do not
inherit default arguments. Actual set of them will be defined at the
point where the containing class is instantiated.

This change fixes PR12724.

Differential Revision: https://reviews.llvm.org/D30393

llvm-svn: 304965
2017-06-08 06:31:19 +00:00
..
basic Print nested name specifiers for typedefs and type aliases 2017-03-10 15:04:58 +00:00
class Fix all tests under test/CXX (and test/Analysis) to pass if clang's default 2016-08-31 23:24:08 +00:00
class.access Switch from using a DiagnosticTrap and a note for "while defining a special 2017-05-25 22:47:05 +00:00
class.derived Add context note to diagnostics that occur while declaring an implicit special member function. 2017-02-23 21:43:43 +00:00
concepts-ts [Concepts] Class template associated constraints 2017-02-10 02:46:19 +00:00
conv [c++1z] P0003R5: Removing dynamic exception specifications. 2016-12-08 02:49:07 +00:00
cpp/cpp.predefined P0035R4: add predefined __STDCPP_DEFAULT_NEW_ALIGNMENT__ macro. By default, we 2016-09-30 22:41:36 +00:00
dcl.dcl Improve diagnostics if friend function redefines file-level function. 2017-06-08 06:07:07 +00:00
dcl.decl Do not inherit default arguments for friend function in class template. 2017-06-08 06:31:19 +00:00
drs [c++1z] Support deducing B in noexcept(B). 2017-06-07 21:46:22 +00:00
except P0012R1: Make exception specifications be part of the type system. This 2016-10-16 17:54:23 +00:00
expr [c++1z] Synthesize implicit deduction guides from constructors on demand. Rank 2017-02-14 00:25:28 +00:00
lex Convert test/CXX/lex/lex.literal/lex.string/p4.cpp back to DOS line 2016-01-04 10:17:48 +00:00
modules-ts [modules ts] Diagnose 'export' declarations outside of a module interface. 2017-04-24 23:12:30 +00:00
over [c++1z] Add some more tests for class template argument deduction, add 2017-02-14 00:55:25 +00:00
special [Sema] Improve the error diagnostic for dot destructor calls on pointer objects 2017-01-20 15:38:58 +00:00
stmt.stmt Try contextually converting condition of constexpr if to Boolean value 2016-09-07 18:24:54 +00:00
temp When determining the target function of an explicit instantiation, make 2017-06-07 23:00:05 +00:00