]> granicus.if.org Git - clang/commit
Diagnose function template definitions inside functions
authorReid Kleckner <reid@kleckner.net>
Mon, 15 Dec 2014 23:16:32 +0000 (23:16 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 15 Dec 2014 23:16:32 +0000 (23:16 +0000)
commit06b9847147cfb26851368ef6acad5c7d81235a8c
tree9df8d92a40eafd1a7e67d1c5aeb264c0d61e07c5
parent2931d65e2fbbe04e21a069bade1c3879991722a0
Diagnose function template definitions inside functions

The parser can only be tricked into parsing a function template
definition by inserting a typename keyword before the function template
declaration. This used to make us crash, and now it's fixed.

While here, remove an unneeded boolean parameter from ParseDeclGroup.
This boolean always corresponded to non-typedef declarators at file
scope. ParseDeclGroup already has precise diagnostics for the function
definition typedef case, so we can let that through.

Fixes PR21839.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224287 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Parse/Parser.h
lib/Parse/ParseDecl.cpp
lib/Parse/ParseTemplate.cpp
lib/Parse/Parser.cpp
test/CXX/drs/dr5xx.cpp
test/Parser/cxx-template-decl.cpp