Allow the user to specify a concrete USR in the external_source_symbol attribute. That will let Clang's indexer to use Swift USRs for Swift declarations that are represented with C++ declarations. This new clause is used by Swift when generating a C++ header representation of a Swift module: https://github.com/apple/swift/pull/63002 Differential Revision: https://reviews.llvm.org/D141324
17 lines
591 B
C++
17 lines
591 B
C++
// RUN: %clang_cc1 -fsyntax-only -fblocks -verify -fdouble-square-bracket-attributes %s
|
|
|
|
template<class T>
|
|
class Class {
|
|
public:
|
|
[[clang::external_source_symbol(language="Swift", defined_in="module", USR="test", generated_declaration)]]
|
|
void testExternalSourceSymbol();
|
|
|
|
// expected-error@+1 {{expected string literal for USR in 'external_source_symbol' attribute}}
|
|
[[clang::external_source_symbol(language="Swift", defined_in="module", USR=T, generated_declaration)]]
|
|
void testExternalSourceSymbol2();
|
|
};
|
|
|
|
template<class T>
|
|
void Class<T>::testExternalSourceSymbol() {
|
|
}
|