summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/Attr.td3
-rw-r--r--clang/test/Parser/cxx0x-attributes.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index d8ba91dcfe1..16e249bcf53 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -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 {
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp
index 7f41be80514..824aeae06d6 100644
--- a/clang/test/Parser/cxx0x-attributes.cpp
+++ b/clang/test/Parser/cxx0x-attributes.cpp
@@ -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()); }
+}
OpenPOWER on IntegriCloud