Skip to content

Commit

Permalink
Add a couple of tests to demonstrate issues with cxx1.DeclarationTargets
Browse files Browse the repository at this point in the history
Summary: See D56349548

Reviewed By: phlalx

Differential Revision: D56628360

fbshipit-source-id: af8caa0b0264355c7d51fe46e206020ce12171f0
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Apr 26, 2024
1 parent d995c71 commit f1ecc67
Show file tree
Hide file tree
Showing 9 changed files with 986 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[
"@generated",
{
"key": {
"sources": [
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "g" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 11,
"lineEnd": 13
}
}
}
}
],
"target": {
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "f" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 11,
"file": { "key": "test.cpp" },
"lineBegin": 9,
"lineEnd": 9
}
}
}
}
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[
"@generated",
{
"key": {
"source": {
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "g" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 11,
"lineEnd": 13
}
}
}
},
"targets": [
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "f" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 11,
"file": { "key": "test.cpp" },
"lineBegin": 9,
"lineEnd": 9
}
}
}
}
]
}
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/

void f() {}

void g() {
auto h = [&]() { f(); };
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
[
"@generated",
{
"key": {
"sources": [
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "f" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
},
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "g" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
},
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "h" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
}
],
"target": {
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "f" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
}
}
},
{
"key": {
"sources": [
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "f" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
},
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "g" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
},
{
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "h" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
}
],
"target": {
"function_": {
"key": {
"name": {
"key": {
"name": { "key": { "name": { "key": "g" } } },
"scope": { "global_": { } }
}
},
"signature": {
"key": { "parameters": [ ], "returns": { "key": "void" } }
},
"source": {
"columnBegin": 1,
"columnEnd": 1,
"file": { "key": "test.cpp" },
"lineBegin": 14,
"lineEnd": 14
}
}
}
}
}
}
]
Loading

0 comments on commit f1ecc67

Please sign in to comment.