https://llvm.org/bugs/show_bug.cgi?id=26836
Bug ID: 26836 Summary: [ms] type conversion with a type named with two words cannot be compiled in if statement Product: clang Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Frontend Assignee: unassignedclangb...@nondot.org Reporter: andrey.kules...@intel.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified !- the way MS compiler works is logical and explainable, because such behavior is user friendly. clang can compile such line: "if( long(t1) < t2 ) ;" a little bit confusing for a user that this line cannot be compiled: "if( unsigned long(t1) < t2 ) ;" I suppose that this feature might be added to clang under fms-compability option -! =========Environment============ Language: c++ OS: Windows Version: trunk =========How to reproduce======== void f(int t1, unsigned long t2 ) { if( unsigned long(t1) < t2 ) ; } =========Error=================== >>> clang: error: variable declaration in condition must have an initializer if( unsigned long(t1) < t2 ) ; error: expected ')' if( unsigned long(t1) < t2 ) ; >>> MSVC/intel icc compiler: no diagnostics >>> gcc: error: expected primary-expression before ‘unsigned’ if( unsigned long(t1) < t2 ) ; error: expected ‘)’ before ‘unsigned’ Andrey Kuleshov ====== Software Engineer Intel Compiler Team -- 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