PR46637: Fix handling of placeholder types in trailing-return-types.
authorRichard Smith <richard@metafoo.co.uk>
Tue, 28 Jul 2020 22:51:13 +0000 (15:51 -0700)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 28 Jul 2020 22:54:10 +0000 (15:54 -0700)
commit9cf98d26e7b1204478cc13ae3df44a6843965c11
tree9e17e1475eb11f32365c47d4ce88abcf0427c07e
parente22de4e46d1dd1aacc3a7060d24bcbe89908ba6c
PR46637: Fix handling of placeholder types in trailing-return-types.

Only permit a placeholder type in a trailing-return-type if it would
also have been permitted in the decl-specifier sequence of a
corresponding declaration with no trailing-return-type. The standard
doesn't actually say this, but this is the only thing that makes sense.

Also fix handling of an 'auto' in a trailing-return-type in a parameter
of a generic lambda. We used to crash if we saw such a thing.
clang/include/clang/Sema/DeclSpec.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaTemplateDeduction.cpp
clang/lib/Sema/SemaType.cpp
clang/test/SemaCXX/auto-type-from-cxx.cpp
clang/test/SemaCXX/cxx1y-deduced-return-type.cpp
clang/test/SemaCXX/cxx1y-generic-lambdas.cpp
clang/test/SemaCXX/trailing-return-0x.cpp
clang/test/SemaTemplate/temp_arg_nontype_cxx1z.cpp