llvm-project/clang/test/PCH/optnone.cpp
Serge Pavlov 9bbefb7f60
[clang] Store FPOptions earlier when parsing function (#92146)
After https://github.com/llvm/llvm-project/pull/85605 ([clang] Set
correct FPOptions if attribute 'optnone' presents) the current FP
options in Sema are saved during parsing function because Sema can
modify them if optnone is present. However they were saved too late, it
caused fails in some cases when precompiled headers are used. This patch
moves the storing earlier.
2024-05-15 23:12:57 +07:00

7 lines
189 B
C++

// RUN: %clang_cc1 -emit-pch -x c++-header %s -o %t.pch
// RUN: %clang_cc1 -emit-llvm -DMAIN -include-pch %t.pch %s -o /dev/null
#ifndef MAIN
__attribute__((optnone)) void foo() {}
#endif