https://bugs.llvm.org/show_bug.cgi?id=34304
Bug ID: 34304
Summary: attribute ignored is a warning with gcc, an error with
clang
Product: clang
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: sylves...@debian.org
CC: llvm-bugs@lists.llvm.org
This impacts a lot of qt programs:
http://clang.debian.net/status.php?version=5.0&key=NO_DISCARD_ATTRIBUTE
Simple example:
int a [[]];
int & [[nodiscard]] b = a;
$ clang++ -std=c++11 -c foo.cpp
foo.cpp:2:9: error: 'nodiscard' attribute cannot be applied to types
int & [[nodiscard]] b = a;
^
1 error generated.
$ g++ -std=c++11 -c foo.cpp
foo.cpp:2:20: warning: attribute ignored [-Wattributes]
int & [[nodiscard]] b = a;
^
foo.cpp:2:20: note: an attribute that appertains to a type-specifier is ignored
As we see clang as a drop-in replacement of gcc, maybe we should not trigger an
error here.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs