llvm-project/clang/test/CodeGenCXX/attr-annotate-constructor.cpp
Brendan Dahl c6d70722b4
[clang][CodeGen] Emit annotations for function declarations. (#66716)
Previously, annotations were only emitted for function definitions. With
this change annotations are also emitted for declarations. Also,
emitting function annotations is now deferred until the end so that the
most up to date declaration is used which will have any inherited
annotations.
2023-11-29 15:13:30 -08:00

11 lines
200 B
C++

// RUN: %clang %s -S -emit-llvm -target x86_64-unknown-linux -o -
// Test annotation attributes on constructors do not crash.
class Foo {
public:
[[clang::annotate("test")]] Foo() {}
};
Foo foo;