forked from OSchip/llvm-project
Treat [[gnu::__const]] the same as [[gnu::const]]. GCC's tokenizer can't tell
the difference. llvm-svn: 193582
This commit is contained in:
parent
451c8de2d8
commit
d0604672d9
|
@ -314,7 +314,8 @@ def Common : InheritableAttr {
|
|||
}
|
||||
|
||||
def Const : InheritableAttr {
|
||||
let Spellings = [GNU<"const">, GNU<"__const">, CXX11<"gnu", "const">];
|
||||
let Spellings = [GNU<"const">, GNU<"__const">,
|
||||
CXX11<"gnu", "const">, CXX11<"gnu", "__const">];
|
||||
}
|
||||
|
||||
def Constructor : InheritableAttr {
|
||||
|
|
|
@ -304,3 +304,11 @@ class A {
|
|||
A([[gnu::unused]] int a);
|
||||
};
|
||||
A::A([[gnu::unused]] int a) {}
|
||||
|
||||
namespace GccConst {
|
||||
// GCC's tokenizer treats const and __const as the same token.
|
||||
[[gnu::const]] int *f1();
|
||||
[[gnu::__const]] int *f2();
|
||||
void f(const int *);
|
||||
void g() { f(f1()); f(f2()); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue