diff --git a/src/languages/cpp.js b/src/languages/cpp.js
index edfbf1cd51..970f584bb3 100644
--- a/src/languages/cpp.js
+++ b/src/languages/cpp.js
@@ -302,7 +302,7 @@ export default function(hljs) {
end: /[{;=]/,
excludeEnd: true,
keywords: CPP_KEYWORDS,
- illegal: /[^\w\s\*&:<>.]/,
+ illegal: /[^\w\s\*&:<>.,]/,
contains: [
{ // to prevent it from being confused as the function title
begin: DECLTYPE_AUTO_RE,
diff --git a/test/markup/cpp/function-declarations.expect.txt b/test/markup/cpp/function-declarations.expect.txt
index fc7cea4c16..b04c01e87f 100644
--- a/test/markup/cpp/function-declarations.expect.txt
+++ b/test/markup/cpp/function-declarations.expect.txt
@@ -21,3 +21,5 @@
void A(): a(10) {}
explicit A(): a(10) {}
+
+extern void f(int), g(char);
diff --git a/test/markup/cpp/function-declarations.txt b/test/markup/cpp/function-declarations.txt
index ced198b2c7..c78ffc21a7 100644
--- a/test/markup/cpp/function-declarations.txt
+++ b/test/markup/cpp/function-declarations.txt
@@ -21,3 +21,5 @@ test();
void A(): a(10) {}
explicit A(): a(10) {}
+
+extern void f(int), g(char);