Close https://github.com/llvm/llvm-project/issues/73023 The direct issue of https://github.com/llvm/llvm-project/issues/73023 is that we entered a header which is marked as pragma once since the compiler think it is OK if there is controlling macro. It doesn't make sense. I feel like it should be sufficient to skip it after we see the '#pragma once'. From the context, it looks like the workaround is primarily for ObjectiveC. So we might need reviewers from OC.
20 lines
280 B
C++
20 lines
280 B
C++
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: split-file %s %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 %t/test.cpp -fsyntax-only -verify
|
|
|
|
//--- i.h
|
|
#ifndef I_H
|
|
#pragma once
|
|
struct S{};
|
|
#endif
|
|
|
|
//--- test.cpp
|
|
// expected-no-diagnostics
|
|
#include "i.h"
|
|
|
|
int foo() {
|
|
return sizeof(S);
|
|
}
|