]> granicus.if.org Git - clang/commit
Reject varargs '...' in function prototype if there are more parameters after
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 11 Aug 2014 23:30:23 +0000 (23:30 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 11 Aug 2014 23:30:23 +0000 (23:30 +0000)
commit444d8c4517ce4f74b52d64cf168bf1b7850ec7f7
treeb6718fe27ee8dc632826ca9e10fa17a6d19f0d2f
parent2f361f76db11d874da12a2f8c2dedf0e81f62fe2
Reject varargs '...' in function prototype if there are more parameters after
it. Diagnose with recovery if it appears after a function parameter that was
obviously supposed to be a parameter pack. Otherwise, warn if it immediately
follows a function parameter pack, because the user most likely didn't intend
to write a parameter pack followed by a C-style varargs ellipsis.

This warning can be syntactically disabled by using ", ..." instead of "...".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215408 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Sema/Sema.h
lib/Parse/ParseDecl.cpp
lib/Sema/SemaTemplateVariadic.cpp
test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp
test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
test/Parser/cxx-variadic-func.cpp
test/Parser/cxx11-templates.cpp
test/SemaCXX/issue547.cpp