diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 3619b8e813104e6ac6b8804bbf4e83c7b6b6bc3f..bfb75d2dd3d479c3c7cc6da09e058e6cc009b353 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -1143,7 +1143,7 @@ void Parser::HandleMemberFunctionDefaultArgs(Declarator& DeclaratorInfo, LateMethod->DefaultArgs.reserve(FTI.NumArgs); for (unsigned I = 0; I < ParamIdx; ++I) LateMethod->DefaultArgs.push_back( - LateParsedDefaultArgument(FTI.ArgInfo[ParamIdx].Param)); + LateParsedDefaultArgument(FTI.ArgInfo[I].Param)); } // Add this parameter to the list of parameters (it or may diff --git a/clang/test/SemaCXX/local-classes.cpp b/clang/test/SemaCXX/local-classes.cpp index 3c216d0863e205b9961a605dcb1316345e038242..6799e58e954e08bf05a59c6d295b187e0fd44238 100644 --- a/clang/test/SemaCXX/local-classes.cpp +++ b/clang/test/SemaCXX/local-classes.cpp @@ -15,3 +15,18 @@ namespace PR6382 { return -1; } } + +namespace PR6383 { + void test (bool gross) + { + struct compare_and_set + { + void operator() (const bool inner, const bool gross = false) + { + // the code + } + } compare_and_set2; + + compare_and_set2 (false, gross); + } +}